Refactor UnitInfluence trait -> world.ActorMap
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
bool ShouldLayMine(Actor self, int2 p)
|
||||
{
|
||||
// if there is no unit (other than me) here, we want to place a mine here
|
||||
return !self.World.WorldActor.Trait<UnitInfluence>()
|
||||
return !self.World.ActorMap
|
||||
.GetUnitsAt(p).Any(a => a != self);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Activities
|
||||
int2? ChooseExitTile(Actor self, Actor cargo)
|
||||
{
|
||||
// is anyone still hogging this tile?
|
||||
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(self.Location).Count() > 1)
|
||||
if (self.World.ActorMap.GetUnitsAt(self.Location).Count() > 1)
|
||||
return null;
|
||||
|
||||
var mobile = cargo.Trait<Mobile>();
|
||||
|
||||
Reference in New Issue
Block a user