mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 15:59:50 +07:00
Don't random-walk to tiles that have units in them!
This commit is contained in:
@ -150,8 +150,13 @@ class GameInfo {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(unit.health < 100){
|
||||||
|
healUnit()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// else, go to a random space
|
// else, go to a random space
|
||||||
unit.moveToTile(distanceToTiles.keys.toList().getRandom())
|
unit.moveToTile(distanceToTiles.keys.filter { it.unit==null }.toList().getRandom())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user