mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 04:43:05 -04:00
Fixed bug where (I assume) if you started a game before version 94, then you may not have any techs at all, and so wwhen you try to fund the player's Era by techs, it finds nothing and explodes
This commit is contained in:
parent
67b9b7ea7a
commit
f08261edaf
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 94
|
||||
versionName "2.5.8"
|
||||
versionCode 95
|
||||
versionName "2.5.9"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -237,9 +237,12 @@ class CivilizationInfo {
|
||||
|
||||
fun isDefeated()= cities.isEmpty() && !getCivUnits().any{it.name=="Settler"}
|
||||
fun getEra(): TechEra {
|
||||
return tech.techsResearched.map { GameBasics.Technologies[it]!! }
|
||||
|
||||
val maxEraOfTech = tech.techsResearched.map { GameBasics.Technologies[it]!! }
|
||||
.map { it.era() }
|
||||
.max()!!
|
||||
.max()
|
||||
if(maxEraOfTech!=null) return maxEraOfTech
|
||||
else return TechEra.Ancient
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user