Skip to content

Commit e43d152

Browse files
committed
Fix: "for every [countable]" should equal 0 when the countable is invalid- round 2
1 parent a5f833d commit e43d152

File tree

1 file changed

+2
-1
lines changed
  • core/src/com/unciv/models/ruleset/unique

1 file changed

+2
-1
lines changed

core/src/com/unciv/models/ruleset/unique/Unique.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
105105
val forEveryAmountModifiers = getModifiers(UniqueType.ForEveryAmountCountable)
106106
for (conditional in forEveryAmountModifiers) { // multiple multipliers DO multiply.
107107
val multiplier = Countables.getCountableAmount(conditional.params[1], stateForConditionals)
108+
?: 0 // If the countable is invalid, ignore this unique entirely
108109
val perEvery = conditional.params[0].toInt()
109-
if (multiplier != null) amount *= multiplier / perEvery
110+
amount *= multiplier / perEvery
110111
}
111112

112113
if (stateForConditionals.relevantTile != null){

0 commit comments

Comments
 (0)