diff --git a/OpenRA.Mods.Cnc/Traits/GpsDot.cs b/OpenRA.Mods.Cnc/Traits/GpsDot.cs index 0e2048d92dbf..d157ef23f0aa 100644 --- a/OpenRA.Mods.Cnc/Traits/GpsDot.cs +++ b/OpenRA.Mods.Cnc/Traits/GpsDot.cs @@ -28,7 +28,7 @@ class GpsDotInfo : ITraitInfo public object Create(ActorInitializer init) { return new GpsDot(this); } } - class GpsDot : INotifyAddedToWorld, INotifyRemovedFromWorld + class GpsDot : INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld { readonly GpsDotInfo info; GpsDotEffect effect; @@ -38,9 +38,13 @@ public GpsDot(GpsDotInfo info) this.info = info; } - void INotifyAddedToWorld.AddedToWorld(Actor self) + void INotifyCreated.Created(Actor self) { effect = new GpsDotEffect(self, info); + } + + void INotifyAddedToWorld.AddedToWorld(Actor self) + { self.World.AddFrameEndTask(w => w.Add(effect)); }