mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 04:43:05 -04:00
If we try to place barbs but there's no room then we just don't place.
This commit is contained in:
parent
98932473eb
commit
d695cbd6f1
@ -58,6 +58,7 @@ class GameInfo {
|
||||
if(tileToPlace==null) {
|
||||
val playerViewableTiles = getPlayerCivilization().getViewableTiles().toHashSet()
|
||||
val viableTiles = tileMap.values.filterNot { playerViewableTiles.contains(it) || it.militaryUnit != null || it.civilianUnit!=null}
|
||||
if(viableTiles.isEmpty()) return // no place for more barbs =(
|
||||
tile=viableTiles.getRandom()
|
||||
}
|
||||
tileMap.placeUnitNearTile(tile!!.position,"Warrior",getBarbarianCivilization())
|
||||
|
Loading…
x
Reference in New Issue
Block a user