Can no longer walk through enemy units =)
This commit is contained in:
parent
db4ad20264
commit
f01b6b665f
1 changed files with 3 additions and 3 deletions
|
@ -36,9 +36,9 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||
for (neighbor in tileToCheck.neighbors) {
|
||||
|
||||
var totalDistanceToTile:Float
|
||||
if (neighbor.getOwner() != unit.civInfo
|
||||
&& neighbor.isCityCenter())
|
||||
totalDistanceToTile = unitMovement // Enemy city, can't move through it - we'll be "stuck" there
|
||||
if ((neighbor.getOwner() != unit.civInfo && neighbor.isCityCenter())// Enemy city,
|
||||
|| neighbor.unit!=null && neighbor.unit!!.civInfo!=unit.civInfo) // Enemy unit
|
||||
totalDistanceToTile = unitMovement // can't move through it - we'll be "stuck" there
|
||||
|
||||
else {
|
||||
val distanceBetweenTiles = getMovementCostBetweenAdjacentTiles(tileToCheck, neighbor)
|
||||
|
|
Loading…
Reference in a new issue