Add a subCell parameter to IPositionableInfo.CanEnterCell
This commit is contained in:
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
// initialized and used by CanEnterCell
|
||||
Locomotor locomotor;
|
||||
|
||||
public bool CanEnterCell(World world, Actor self, CPos cell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
|
||||
public bool CanEnterCell(World world, Actor self, CPos cell, SubCell subCell = SubCell.FullCell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
|
||||
{
|
||||
// PERF: Avoid repeated trait queries on the hot path
|
||||
if (locomotor == null)
|
||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (locomotor.MovementCostForCell(cell) == short.MaxValue)
|
||||
return false;
|
||||
|
||||
return locomotor.CanMoveFreelyInto(self, cell, check, ignoreActor);
|
||||
return locomotor.CanMoveFreelyInto(self, cell, subCell, check, ignoreActor);
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<CPos, SubCell> OccupiedCells(ActorInfo info, CPos location, SubCell subCell = SubCell.Any)
|
||||
@@ -501,7 +501,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public bool CanEnterCell(CPos cell, Actor ignoreActor = null, BlockedByActor check = BlockedByActor.All)
|
||||
{
|
||||
return Info.CanEnterCell(self.World, self, cell, ignoreActor, check);
|
||||
return Info.CanEnterCell(self.World, self, cell, SubCell.FullCell, ignoreActor, check);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user