Add a subCell parameter to IPositionableInfo.CanEnterCell
This commit is contained in:
@@ -246,6 +246,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// Determines whether the actor is blocked by other Actors
|
||||
public bool CanMoveFreelyInto(Actor actor, CPos cell, BlockedByActor check, Actor ignoreActor)
|
||||
{
|
||||
return CanMoveFreelyInto(actor, cell, SubCell.FullCell, check, ignoreActor);
|
||||
}
|
||||
|
||||
public bool CanMoveFreelyInto(Actor actor, CPos cell, SubCell subCell, BlockedByActor check, Actor ignoreActor)
|
||||
{
|
||||
var cellCache = GetCache(cell);
|
||||
var cellFlag = cellCache.CellFlag;
|
||||
@@ -296,7 +301,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var otherActor in world.ActorMap.GetActorsAt(cell))
|
||||
var otherActors = subCell == SubCell.FullCell ? world.ActorMap.GetActorsAt(cell) : world.ActorMap.GetActorsAt(cell, subCell);
|
||||
foreach (var otherActor in otherActors)
|
||||
if (IsBlockedBy(actor, otherActor, ignoreActor, check, cellFlag))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user