mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-25 07:09:16 +07:00
Barbarians no longer spawn on mountains and lakes (a bit silly)
This commit is contained in:
@ -218,7 +218,7 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
|
|||||||
* [Christ the redeemer](https://thenounproject.com/term/christ-the-redeemer/56112/) By Stefan Spieler for Cristo Redentor
|
* [Christ the redeemer](https://thenounproject.com/term/christ-the-redeemer/56112/) By Stefan Spieler for Cristo Redentor
|
||||||
* [St. Petersburg](https://thenounproject.com/search/?q=kremlin&i=1569704) By Carpe Diem for Kremlin
|
* [St. Petersburg](https://thenounproject.com/search/?q=kremlin&i=1569704) By Carpe Diem for Kremlin
|
||||||
* [Neuschwanstein](https://thenounproject.com/search/?q=Neuschwanstein&i=2107683) By Vectors Market
|
* [Neuschwanstein](https://thenounproject.com/search/?q=Neuschwanstein&i=2107683) By Vectors Market
|
||||||
* [BugBen](https://thenounproject.com/search/?q=Big%20Ben&i=443690) By Ben Davis, RO
|
* [Big Ben](https://thenounproject.com/search/?q=Big%20Ben&i=443690) By Ben Davis, RO
|
||||||
|
|
||||||
### Information Era
|
### Information Era
|
||||||
|
|
||||||
|
@ -86,7 +86,9 @@ class GameInfo {
|
|||||||
// Barbarians will only spawn in places that no one can see
|
// Barbarians will only spawn in places that no one can see
|
||||||
val allViewableTiles = civilizations.filterNot { it.isBarbarianCivilization() }
|
val allViewableTiles = civilizations.filterNot { it.isBarbarianCivilization() }
|
||||||
.flatMap { it.viewableTiles }.toHashSet()
|
.flatMap { it.viewableTiles }.toHashSet()
|
||||||
val viableTiles = tileMap.values.filterNot { allViewableTiles.contains(it) || it.militaryUnit != null || it.civilianUnit != null }
|
val viableTiles = tileMap.values.filter { it.militaryUnit == null
|
||||||
|
&& it.civilianUnit == null && !it.getBaseTerrain().impassable && it.baseTerrain!="Lakes"
|
||||||
|
&& !allViewableTiles.contains(it)}
|
||||||
if (viableTiles.isEmpty()) return // no place for more barbs =(
|
if (viableTiles.isEmpty()) return // no place for more barbs =(
|
||||||
tile = viableTiles.random()
|
tile = viableTiles.random()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user