GetAvailableSubCell should block cells outside the map
This commit is contained in:
@@ -298,8 +298,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public SubCell GetAvailableSubCell(Actor self, CPos cell, SubCell preferredSubCell = SubCell.Any, Actor ignoreActor = null, CellConditions check = CellConditions.All)
|
public SubCell GetAvailableSubCell(Actor self, CPos cell, SubCell preferredSubCell = SubCell.Any, Actor ignoreActor = null, CellConditions check = CellConditions.All)
|
||||||
{
|
{
|
||||||
var cost = cellsCost[cell];
|
if (MovementCostForCell(cell) == short.MaxValue)
|
||||||
if (cost == short.MaxValue)
|
|
||||||
return SubCell.Invalid;
|
return SubCell.Invalid;
|
||||||
|
|
||||||
if (check.HasCellCondition(CellConditions.TransientActors))
|
if (check.HasCellCondition(CellConditions.TransientActors))
|
||||||
|
|||||||
Reference in New Issue
Block a user