mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Removed hydro plant from loaded games
This commit is contained in:
parent
f86736db6d
commit
4423dadefd
@ -280,7 +280,7 @@
|
||||
name:"Harbor",
|
||||
maintenance:2,
|
||||
hurryCostModifier:25,
|
||||
uniques:["+1 production from all sea resources worked by the city","Connects trade routes over water"]
|
||||
uniques:["+1 production from all sea resources worked by the city","Connects trade routes over water"] // todo - trade routes over water!
|
||||
requiredTech:"Compass"
|
||||
},
|
||||
{
|
||||
|
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 151
|
||||
versionName "2.9.5"
|
||||
versionCode 152
|
||||
versionName "2.9.6"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -27,20 +27,16 @@ class UnCivGame : Game() {
|
||||
GameBasics.run { } // just to initialize the GameBasics
|
||||
settings = GameSaver().getGeneralSettings()
|
||||
if (GameSaver().getSave("Autosave").exists()) {
|
||||
try {
|
||||
// try {
|
||||
loadGame("Autosave")
|
||||
} catch (ex: Exception) { // silent fail if we can't read the autosave
|
||||
startNewGame()
|
||||
}
|
||||
// } catch (ex: Exception) { // silent fail if we can't read the autosave
|
||||
// startNewGame()
|
||||
// }
|
||||
}
|
||||
else startNewGame() // screen=LanguagePickerScreen() disabled because of people's negative reviews =(
|
||||
}
|
||||
|
||||
fun loadGame(gameInfo:GameInfo){
|
||||
// As of 2.9.6, removed hydro plat, since it requires rivers, which we do not yet have
|
||||
gameInfo.civilizations.flatMap { it.cities }.map { it.cityConstructions }
|
||||
.forEach{if("Hydro Plant" in it.builtBuildings) it.builtBuildings.remove("Hydro Plant")}
|
||||
|
||||
this.gameInfo = gameInfo
|
||||
if(settings.tutorialsShown.isEmpty() && this.gameInfo.tutorial.isNotEmpty())
|
||||
settings.tutorialsShown.addAll(this.gameInfo.tutorial)
|
||||
|
@ -95,8 +95,19 @@ class GameInfo {
|
||||
}
|
||||
|
||||
for (civInfo in civilizations)
|
||||
for (cityInfo in civInfo.cities)
|
||||
for (cityInfo in civInfo.cities) {
|
||||
|
||||
val cityConstructions = cityInfo.cityConstructions
|
||||
// As of 2.9.6, removed hydro plant, since it requires rivers, which we do not yet have
|
||||
if("Hydro Plant" in cityConstructions.builtBuildings)
|
||||
cityConstructions.builtBuildings.remove("Hydro Plant")
|
||||
if(cityConstructions.currentConstruction=="Hydro Plant") {
|
||||
cityConstructions.currentConstruction=""
|
||||
cityConstructions.chooseNextConstruction()
|
||||
}
|
||||
|
||||
cityInfo.cityStats.update()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -154,6 +154,7 @@ class CityInfo {
|
||||
expansion.setTransients()
|
||||
cityStats.cityInfo = this
|
||||
cityConstructions.cityInfo = this
|
||||
|
||||
}
|
||||
|
||||
fun endTurn() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user