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