mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-22 02:07:43 +07:00
Avoid crash from giving ai free techs.
This commit is contained in:
parent
faf5803b1d
commit
e3c9567904
@ -31,8 +31,6 @@ class GameStarter{
|
|||||||
for (nationName in GameBasics.Nations.keys.filterNot { it=="Barbarians" || it==newGameParameters.nation }.shuffled()
|
for (nationName in GameBasics.Nations.keys.filterNot { it=="Barbarians" || it==newGameParameters.nation }.shuffled()
|
||||||
.take(newGameParameters.numberOfEnemies)) {
|
.take(newGameParameters.numberOfEnemies)) {
|
||||||
val civ = CivilizationInfo(nationName)
|
val civ = CivilizationInfo(nationName)
|
||||||
for (tech in gameInfo.getDifficulty().aiFreeTechs)
|
|
||||||
civ.tech.addTechnology(tech)
|
|
||||||
gameInfo.civilizations.add(civ)
|
gameInfo.civilizations.add(civ)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +39,11 @@ class GameStarter{
|
|||||||
|
|
||||||
gameInfo.setTransients() // needs to be before placeBarbarianUnit because it depends on the tilemap having its gameinfo set
|
gameInfo.setTransients() // needs to be before placeBarbarianUnit because it depends on the tilemap having its gameinfo set
|
||||||
|
|
||||||
|
for (civInfo in gameInfo.civilizations.filter {!it.isBarbarianCivilization() && !it.isPlayerCivilization()}) {
|
||||||
|
for (tech in gameInfo.getDifficulty().aiFreeTechs)
|
||||||
|
civInfo.tech.addTechnology(tech)
|
||||||
|
}
|
||||||
|
|
||||||
// and only now do we add units for everyone, because otherwise both the gameInfo.setTransients() and the placeUnit will both add the unit to the civ's unit list!
|
// and only now do we add units for everyone, because otherwise both the gameInfo.setTransients() and the placeUnit will both add the unit to the civ's unit list!
|
||||||
|
|
||||||
for (civ in gameInfo.civilizations.filter { !it.isBarbarianCivilization() }) {
|
for (civ in gameInfo.civilizations.filter { !it.isBarbarianCivilization() }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user