mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-16 02:40:41 +07:00
Trying to find the cause of #5729
This commit is contained in:
@ -51,7 +51,9 @@ class CivInfoStats(val civInfo: CivilizationInfo) {
|
|||||||
}
|
}
|
||||||
// Sort by descending maintenance, then drop most expensive X units to make them free
|
// Sort by descending maintenance, then drop most expensive X units to make them free
|
||||||
// If more free than units left, returns empty sequence
|
// 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 numberOfUnitsToPayFor = max(0.0, unitsToPayFor.sumOf { it.maintenance.toDouble() }).toFloat()
|
||||||
|
|
||||||
val turnLimit =
|
val turnLimit =
|
||||||
|
@ -790,7 +790,7 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
|
|||||||
return ruleset.tileImprovements[improvementUnique.params[0]]
|
return ruleset.tileImprovements[improvementUnique.params[0]]
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isSellable() = !isAnyWonder() && !uniques.contains("Unsellable")
|
fun isSellable() = !isAnyWonder() && !hasUnique(UniqueType.Unsellable)
|
||||||
|
|
||||||
override fun getResourceRequirements(): HashMap<String, Int> {
|
override fun getResourceRequirements(): HashMap<String, Int> {
|
||||||
val resourceRequirements = 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),
|
MustBeNextTo("Must be next to [terrainFilter]", UniqueTarget.Building),
|
||||||
MustNotBeNextTo("Must not be next to [terrainFilter]", UniqueTarget.Building),
|
MustNotBeNextTo("Must not be next to [terrainFilter]", UniqueTarget.Building),
|
||||||
|
|
||||||
|
Unsellable("Unsellable", UniqueTarget.Building),
|
||||||
|
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user