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
1 changed files with 1 additions and 0 deletions
|
@ -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…
Reference in a new issue