Let immovable actors block individual minefield cells.

This commit is contained in:
tovl
2019-09-15 23:46:51 +02:00
committed by abcdefg30
parent 9a0916afbb
commit c18857f15d
3 changed files with 42 additions and 13 deletions

View File

@@ -100,12 +100,17 @@ namespace OpenRA.Mods.Cnc.Activities
return true;
}
public void CleanPlacedMines(Actor self)
public void CleanMineField(Actor self)
{
// Remove cells that have already been mined
// or that are revealed to be unmineable.
if (minefield != null)
{
var positionable = (IPositionable)movement;
minefield.RemoveAll(c => self.World.ActorMap.GetActorsAt(c)
.Any(a => a.Info.Name == minelayer.Info.Mine.ToLowerInvariant()));
.Any(a => a.Info.Name == minelayer.Info.Mine.ToLowerInvariant()) ||
(!positionable.CanEnterCell(c, null, BlockedByActor.Immovable) && !self.World.FogObscures(c)));
}
}
public override IEnumerable<TargetLineNode> TargetLineNodes(Actor self)