Merge pull request #10795 from Mailaender/screenmap-bounds-crash

Fixed screen map updates for invisible mobile actors
This commit is contained in:
Oliver Brakmann
2016-02-27 17:52:49 +01:00
5 changed files with 45 additions and 38 deletions

View File

@@ -194,6 +194,35 @@ namespace OpenRA
player.Shroud.ExploreAll(this);
}
public void AddToMaps(Actor self, IOccupySpace ios)
{
ActorMap.AddInfluence(self, ios);
ActorMap.AddPosition(self, ios);
if (!self.Bounds.Size.IsEmpty)
ScreenMap.Add(self);
}
public void UpdateMaps(Actor self, IOccupySpace ios)
{
if (!self.IsInWorld)
return;
if (!self.Bounds.Size.IsEmpty)
ScreenMap.Update(self);
ActorMap.UpdatePosition(self, ios);
}
public void RemoveFromMaps(Actor self, IOccupySpace ios)
{
ActorMap.RemoveInfluence(self, ios);
ActorMap.RemovePosition(self, ios);
if (!self.Bounds.Size.IsEmpty)
ScreenMap.Remove(self);
}
public void LoadComplete(WorldRenderer wr)
{
// ScreenMap must be initialized before anything else