mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-24 06:39:16 +07:00
Can no longer walk through enemy units =)
This commit is contained in:
@ -36,9 +36,9 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
|||||||
for (neighbor in tileToCheck.neighbors) {
|
for (neighbor in tileToCheck.neighbors) {
|
||||||
|
|
||||||
var totalDistanceToTile:Float
|
var totalDistanceToTile:Float
|
||||||
if (neighbor.getOwner() != unit.civInfo
|
if ((neighbor.getOwner() != unit.civInfo && neighbor.isCityCenter())// Enemy city,
|
||||||
&& neighbor.isCityCenter())
|
|| neighbor.unit!=null && neighbor.unit!!.civInfo!=unit.civInfo) // Enemy unit
|
||||||
totalDistanceToTile = unitMovement // Enemy city, can't move through it - we'll be "stuck" there
|
totalDistanceToTile = unitMovement // can't move through it - we'll be "stuck" there
|
||||||
|
|
||||||
else {
|
else {
|
||||||
val distanceBetweenTiles = getMovementCostBetweenAdjacentTiles(tileToCheck, neighbor)
|
val distanceBetweenTiles = getMovementCostBetweenAdjacentTiles(tileToCheck, neighbor)
|
||||||
|
Reference in New Issue
Block a user