diff --git a/buildSrc/src/main/kotlin/BuildConfig.kt b/buildSrc/src/main/kotlin/BuildConfig.kt index 5f234b23a1..6655b1016b 100644 --- a/buildSrc/src/main/kotlin/BuildConfig.kt +++ b/buildSrc/src/main/kotlin/BuildConfig.kt @@ -3,8 +3,8 @@ package com.unciv.build object BuildConfig { const val kotlinVersion = "1.4.30" const val appName = "Unciv" - const val appCodeNumber = 604 - const val appVersion = "3.16.2" + const val appCodeNumber = 605 + const val appVersion = "3.16.2-patch1" const val gdxVersion = "1.10.0" const val roboVMVersion = "2.3.1" diff --git a/changelog.md b/changelog.md index a7c5659761..e77482d330 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +## 3.16.2-patch1 + +Fixed diplomacy screen crash for city-states with no cities + +Added mod check for units whose unitType is not defined + +Fixed crash when selecting certain buildings in the civilopedia - by xlenstra + ## 3.16.2 Fixed crashing Diplomatic victory bug diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 9d02cf18b7..c9aa0ad754 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -262,9 +262,7 @@ class CivilizationInfo { } + policies.policyUniques.getUniques(uniqueTemplate) + tech.techUniques.getUniques(uniqueTemplate) + - temporaryUniques.filter { it.first.placeholderText == uniqueTemplate }.map { it.first } + - if (religionManager.religion != null) religionManager.religion!!.getFounderUniques().asSequence() - else sequenceOf() + temporaryUniques.filter { it.first.placeholderText == uniqueTemplate }.map { it.first } } //region Units @@ -371,7 +369,9 @@ class CivilizationInfo { otherCiv.addNotification(meetString, cityStateLocation, NotificationIcon.Gold) else otherCiv.addNotification(meetString, NotificationIcon.Gold) - otherCiv.addStats(giftAmount) + + for (stat in giftAmount.toHashMap().filter { it.value != 0f }) + otherCiv.addStat(stat.key, stat.value.toInt()) } fun discoverNaturalWonder(naturalWonderName: String) { @@ -711,13 +711,6 @@ class CivilizationInfo { } } - /** Rounds each of the stats down to the nearest integer */ - fun addStats(stats: Stats) { - for (stat in stats.toHashMap()) { - addStat(stat.key, stat.value.toInt()) - } - } - fun getStatReserve(stat: Stat): Int { return when (stat) { Stat.Culture -> policies.storedCulture diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index 0538dc28ed..099b0dcc9a 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -289,6 +289,7 @@ class Ruleset { fun isError() = status == CheckModLinksStatus.Error fun isNotOK() = status != CheckModLinksStatus.OK } + fun checkModLinks(): CheckModLinksResult { val lines = ArrayList() var warningCount = 0 @@ -338,8 +339,9 @@ class Ruleset { lines += "${unit.name} replaces ${unit.replaces} which does not exist!" for (promotion in unit.promotions) if (!unitPromotions.containsKey(promotion)) - lines += "${unit.replaces} contains promotion $promotion which does not exist!" - + lines += "${unit.name} contains promotion $promotion which does not exist!" + if (!unitTypes.containsKey(unit.unitType)) + lines += "${unit.name} is of type ${unit.unitType}, which does not exist!" } for (building in buildings.values) {