diff --git a/core/src/com/unciv/logic/civilization/CivInfoStats.kt b/core/src/com/unciv/logic/civilization/CivInfoStats.kt index 2b3c74a48e..4b6ea49ce0 100644 --- a/core/src/com/unciv/logic/civilization/CivInfoStats.kt +++ b/core/src/com/unciv/logic/civilization/CivInfoStats.kt @@ -51,7 +51,9 @@ class CivInfoStats(val civInfo: CivilizationInfo) { } // Sort by descending maintenance, then drop most expensive X units to make them free // If more free than units left, returns empty sequence - unitsToPayFor = unitsToPayFor.sortedByDescending { it.maintenance }.drop(freeUnits) + // There's something here that causes a bug and I'm not sure where, so let's try taking this apart piece by piece + unitsToPayFor = unitsToPayFor.sortedByDescending { it.maintenance }.toList().asSequence() + unitsToPayFor = unitsToPayFor.drop(freeUnits) val numberOfUnitsToPayFor = max(0.0, unitsToPayFor.sumOf { it.maintenance.toDouble() }).toFloat() val turnLimit = diff --git a/core/src/com/unciv/models/ruleset/Building.kt b/core/src/com/unciv/models/ruleset/Building.kt index 8781a5a10b..1e2ea7243f 100644 --- a/core/src/com/unciv/models/ruleset/Building.kt +++ b/core/src/com/unciv/models/ruleset/Building.kt @@ -790,7 +790,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction { return ruleset.tileImprovements[improvementUnique.params[0]] } - fun isSellable() = !isAnyWonder() && !uniques.contains("Unsellable") + fun isSellable() = !isAnyWonder() && !hasUnique(UniqueType.Unsellable) override fun getResourceRequirements(): HashMap { val resourceRequirements = HashMap() diff --git a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt index 6bdf3802c8..edfcd4dbb4 100644 --- a/core/src/com/unciv/models/ruleset/unique/UniqueType.kt +++ b/core/src/com/unciv/models/ruleset/unique/UniqueType.kt @@ -209,6 +209,9 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags: MustBeNextTo("Must be next to [terrainFilter]", UniqueTarget.Building), MustNotBeNextTo("Must not be next to [terrainFilter]", UniqueTarget.Building), + Unsellable("Unsellable", UniqueTarget.Building), + + //endregion