Fix a crash in d2k caused by empty bounds

This adds respective checks to Building.cs.
This commit is contained in:
abcdefg30
2016-01-25 16:44:17 +01:00
parent 386acdcfc9
commit d087a16042

View File

@@ -183,6 +183,8 @@ namespace OpenRA.Mods.Common.Traits
{
self.World.ActorMap.AddInfluence(self, this);
self.World.ActorMap.AddPosition(self, this);
if (!self.Bounds.Size.IsEmpty)
self.World.ScreenMap.Add(self);
}
@@ -190,6 +192,8 @@ namespace OpenRA.Mods.Common.Traits
{
self.World.ActorMap.RemoveInfluence(self, this);
self.World.ActorMap.RemovePosition(self, this);
if (!self.Bounds.Size.IsEmpty)
self.World.ScreenMap.Remove(self);
}