mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 07:16:54 +07:00
Can no longer walk through enemy units =)
This commit is contained in:
parent
db4ad20264
commit
f01b6b665f
@ -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 New Issue
Block a user