mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-25 22:59:12 +07:00
Trying to find the cause of #5729
This commit is contained in:
parent
0d4da03b7c
commit
144d2738a4
@ -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 =
|
||||
|
@ -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<String, Int> {
|
||||
val resourceRequirements = HashMap<String, Int>()
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user