diff --git a/android/build.gradle b/android/build.gradle index 5558c58409..bb4a227188 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,7 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 243 + versionCode 244 versionName "2.16.7" } diff --git a/core/src/com/unciv/logic/city/CityConstructions.kt b/core/src/com/unciv/logic/city/CityConstructions.kt index 7545b9d7cf..4026880234 100644 --- a/core/src/com/unciv/logic/city/CityConstructions.kt +++ b/core/src/com/unciv/logic/city/CityConstructions.kt @@ -143,6 +143,8 @@ class CityConstructions { } fun constructIfEnough(){ + stopUnbuildableConstruction() + val construction = getConstruction(currentConstruction) if(construction is SpecialConstruction) return @@ -154,10 +156,16 @@ class CityConstructions { } fun endTurn(cityStats: Stats) { - val construction = getConstruction(currentConstruction) - if(construction is SpecialConstruction) return + stopUnbuildableConstruction() + if(getConstruction(currentConstruction) !is SpecialConstruction) + addProductionPoints(Math.round(cityStats.production)) + } + + private fun stopUnbuildableConstruction() { // Let's try to remove the building from the city, and see if we can still build it (we need to remove because of wonders etc.) + val construction = getConstruction(currentConstruction) + val saveCurrentConstruction = currentConstruction currentConstruction = "" if (!construction.isBuildable(this)) { @@ -166,8 +174,6 @@ class CityConstructions { chooseNextConstruction() } else currentConstruction = saveCurrentConstruction - - addProductionPoints(Math.round(cityStats.production)) } fun constructionComplete(construction: IConstruction) {