Spatially partition SatelliteLaunch and GpsSatellite effects
This commit is contained in:
@@ -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<GpsWatcher>();
|
||||
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<IRenderable> Render(WorldRenderer wr)
|
||||
|
||||
Reference in New Issue
Block a user