made Expand a bit more sensible
This commit is contained in:
@@ -66,6 +66,8 @@ namespace OpenRA
|
|||||||
|
|
||||||
if (thisCost == float.PositiveInfinity)
|
if (thisCost == float.PositiveInfinity)
|
||||||
return p.Location;
|
return p.Location;
|
||||||
|
|
||||||
|
var bi = world.WorldActor.traits.Get<BuildingInfluence>();
|
||||||
|
|
||||||
foreach( int2 d in directions )
|
foreach( int2 d in directions )
|
||||||
{
|
{
|
||||||
@@ -81,8 +83,7 @@ namespace OpenRA
|
|||||||
if (costHere == float.PositiveInfinity)
|
if (costHere == float.PositiveInfinity)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!world.WorldActor.traits.Get<BuildingInfluence>().CanMoveHere(newHere) &&
|
if (!bi.CanMoveHere(newHere, ignoreBuilding))
|
||||||
world.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt(newHere) != ignoreBuilding)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Replicate real-ra behavior of not being able to enter a cell if there is a mixture of crushable and uncrushable units
|
// Replicate real-ra behavior of not being able to enter a cell if there is a mixture of crushable and uncrushable units
|
||||||
|
|||||||
@@ -70,4 +70,10 @@ namespace OpenRA.Traits
|
|||||||
{
|
{
|
||||||
return map.IsInMap(cell) && !blocked[cell.X, cell.Y];
|
return map.IsInMap(cell) && !blocked[cell.X, cell.Y];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanMoveHere(int2 cell, Actor toIgnore)
|
||||||
|
{
|
||||||
|
return map.IsInMap(cell) &&
|
||||||
|
(!blocked[cell.X, cell.Y] || influence[cell.X, cell.Y] == toIgnore);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user