Fixed bug where you could buy the same buildings multiple times - thanks vita10g!

This commit is contained in:
Yair Morgenstern
2018-08-09 10:10:49 +03:00
parent 9b38d0c33e
commit 97bb4e05b9
2 changed files with 6 additions and 3 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 116
versionName "2.7.4"
versionCode 117
versionName "2.7.5"
}
buildTypes {
release {

View File

@ -146,7 +146,10 @@ class CityConstructions {
fun purchaseBuilding(buildingName: String) {
cityInfo.civInfo.gold -= getConstruction(buildingName).getGoldCost(cityInfo.civInfo.policies.adoptedPolicies)
getConstruction(buildingName).postBuildEvent(this)
if (currentConstruction == buildingName) Automation().chooseNextConstruction(this)
if (currentConstruction == buildingName) {
currentConstruction=""
Automation().chooseNextConstruction(this)
}
cityInfo.cityStats.update()
}