Simplify ScreenMap bounds checking.

This commit is contained in:
Paul Chote
2017-12-03 15:17:07 +00:00
committed by reaperrr
parent cdc426d162
commit 9e18ec7314
4 changed files with 13 additions and 23 deletions

View File

@@ -56,18 +56,14 @@ namespace OpenRA.Mods.Common.Traits
{
self.World.ActorMap.AddInfluence(self, this);
self.World.ActorMap.AddPosition(self, this);
if (!self.RenderBounds.Size.IsEmpty)
self.World.ScreenMap.Add(self);
self.World.ScreenMap.Add(self);
}
void INotifyRemovedFromWorld.RemovedFromWorld(Actor self)
{
self.World.ActorMap.RemoveInfluence(self, this);
self.World.ActorMap.RemovePosition(self, this);
if (!self.RenderBounds.Size.IsEmpty)
self.World.ScreenMap.Remove(self);
self.World.ScreenMap.Remove(self);
}
}
}