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,14 +183,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);
}
public void NotifyBuildingComplete(Actor self)