diff --git a/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs b/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs index 7ef7efdb1d..5779b7840a 100644 --- a/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs +++ b/OpenRA.Mods.Cnc/Effects/GpsSatellite.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Cnc.Traits; namespace OpenRA.Mods.Cnc.Effects { - class GpsSatellite : IEffect + class GpsSatellite : IEffect, ISpatiallyPartitionable { readonly Player launcher; readonly Animation anim; @@ -34,6 +34,7 @@ namespace OpenRA.Mods.Cnc.Effects anim = new Animation(world, image); anim.PlayRepeating(sequence); + world.ScreenMap.Add(this, pos, anim.Image); } public void Tick(World world) @@ -45,8 +46,10 @@ namespace OpenRA.Mods.Cnc.Effects { var watcher = launcher.PlayerActor.Trait(); watcher.ReachedOrbit(launcher); - world.AddFrameEndTask(w => w.Remove(this)); + world.AddFrameEndTask(w => { w.Remove(this); w.ScreenMap.Remove(this); }); } + + world.ScreenMap.Update(this, pos, anim.Image); } public IEnumerable Render(WorldRenderer wr) diff --git a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs index 9afdaa88be..3e6b92b03f 100644 --- a/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs +++ b/OpenRA.Mods.Cnc/Effects/SatelliteLaunch.cs @@ -16,7 +16,7 @@ using OpenRA.Mods.Cnc.Traits; namespace OpenRA.Mods.Cnc.Effects { - class SatelliteLaunch : IEffect + class SatelliteLaunch : IEffect, ISpatiallyPartitionable { readonly GpsPowerInfo info; readonly Actor launcher; @@ -31,14 +31,16 @@ namespace OpenRA.Mods.Cnc.Effects doors = new Animation(launcher.World, info.DoorImage); doors.PlayThen(info.DoorSequence, - () => launcher.World.AddFrameEndTask(w => w.Remove(this))); + () => launcher.World.AddFrameEndTask(w => { w.Remove(this); w.ScreenMap.Remove(this); })); pos = launcher.CenterPosition; + launcher.World.ScreenMap.Add(this, pos, doors.Image); } public void Tick(World world) { doors.Tick(); + world.ScreenMap.Update(this, pos, doors.Image); if (++frame == 19) {