Use World.(AddTo|RemoveFrom)Maps in Immobile/Building.

This commit is contained in:
Paul Chote
2017-12-03 20:55:23 +00:00
committed by reaperrr
parent 9e18ec7314
commit 373aaee004
2 changed files with 4 additions and 14 deletions

View File

@@ -311,19 +311,13 @@ namespace OpenRA.Mods.Common.Traits
if (Info.RemoveSmudgesOnBuild) if (Info.RemoveSmudgesOnBuild)
RemoveSmudges(); RemoveSmudges();
self.World.ActorMap.AddInfluence(self, this); self.World.AddToMaps(self, this);
self.World.ActorMap.AddPosition(self, this);
self.World.ScreenMap.Add(self);
influence.AddInfluence(self, Info.Tiles(self.Location)); influence.AddInfluence(self, Info.Tiles(self.Location));
} }
void INotifyRemovedFromWorld.RemovedFromWorld(Actor self) void INotifyRemovedFromWorld.RemovedFromWorld(Actor self)
{ {
self.World.ActorMap.RemoveInfluence(self, this); self.World.RemoveFromMaps(self, this);
self.World.ActorMap.RemovePosition(self, this);
self.World.ScreenMap.Remove(self);
influence.RemoveInfluence(self, Info.Tiles(self.Location)); influence.RemoveInfluence(self, Info.Tiles(self.Location));
} }

View File

@@ -54,16 +54,12 @@ namespace OpenRA.Mods.Common.Traits
void INotifyAddedToWorld.AddedToWorld(Actor self) void INotifyAddedToWorld.AddedToWorld(Actor self)
{ {
self.World.ActorMap.AddInfluence(self, this); self.World.AddToMaps(self, this);
self.World.ActorMap.AddPosition(self, this);
self.World.ScreenMap.Add(self);
} }
void INotifyRemovedFromWorld.RemovedFromWorld(Actor self) void INotifyRemovedFromWorld.RemovedFromWorld(Actor self)
{ {
self.World.ActorMap.RemoveInfluence(self, this); self.World.RemoveFromMaps(self, this);
self.World.ActorMap.RemovePosition(self, this);
self.World.ScreenMap.Remove(self);
} }
} }
} }