Merge pull request #10462 from RoosterDragon/partition-no-empty

Prevent items without size from being added to SpatiallyPartitioned.
This commit is contained in:
Oliver Brakmann
2016-01-24 20:59:25 +01:00
2 changed files with 14 additions and 2 deletions

View File

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