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)
RemoveSmudges();
self.World.ActorMap.AddInfluence(self, this);
self.World.ActorMap.AddPosition(self, this);
self.World.ScreenMap.Add(self);
self.World.AddToMaps(self, this);
influence.AddInfluence(self, Info.Tiles(self.Location));
}
void INotifyRemovedFromWorld.RemovedFromWorld(Actor self)
{
self.World.ActorMap.RemoveInfluence(self, this);
self.World.ActorMap.RemovePosition(self, this);
self.World.ScreenMap.Remove(self);
self.World.RemoveFromMaps(self, this);
influence.RemoveInfluence(self, Info.Tiles(self.Location));
}

View File

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