Fixed "huge stats in cities" bug

This commit is contained in:
Yair Morgenstern 2019-07-26 15:06:21 +03:00
parent b08b64a935
commit 42e5f3b883
2 changed files with 5 additions and 3 deletions

View File

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.app" applicationId "com.unciv.app"
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 28 targetSdkVersion 28
versionCode 276 versionCode 278
versionName "2.18.5" versionName "2.18.6-patch1"
} }
// Had to add this crap for Travis to build, it wanted to sign the app // Had to add this crap for Travis to build, it wanted to sign the app

View File

@ -100,6 +100,8 @@ open class Stats() {
class StatMap:LinkedHashMap<String,Stats>(){ class StatMap:LinkedHashMap<String,Stats>(){
fun add(source:String,stats:Stats){ fun add(source:String,stats:Stats){
if(!containsKey(source)) put(source,stats) if(!containsKey(source)) put(source,stats)
else get(source)!!.add(stats) else get(source)!!.plus(stats)
// This CAN'T be get(source)!!.add() because the initial stats we get are sometimes from other places -
// for instance the Cities is from the currentCityStats and if we add to that we change the value in the cities themselves!
} }
} }