Allow combatantFilter for cities to use cityFilter

This commit is contained in:
Yair Morgenstern 2024-02-09 12:44:56 +02:00
parent eb984f06dc
commit a9c367907d
2 changed files with 3 additions and 2 deletions

View File

@ -24,7 +24,7 @@ class CityCombatant(val city: City) : ICombatant {
override fun isDefeated(): Boolean = city.health == 1
override fun isInvisible(to: Civilization): Boolean = false
override fun canAttack(): Boolean = city.canBombard()
override fun matchesFilter(filter: String) = MultiFilter.multiFilter(filter, {it == "City" || it == "All" || city.civ.matchesFilter(it)})
override fun matchesFilter(filter: String) = MultiFilter.multiFilter(filter, {it == "City" || it == "All" || city.matchesFilter(it)})
override fun getAttackSound() = UncivSound.Bombard
override fun takeDamage(damage: Int) {

View File

@ -86,8 +86,9 @@ enum class UniqueParameterType(
UniqueType.UniqueParameterErrorSeverity? = getErrorSeverityForFilter(parameterText, ruleset)
override fun isKnownValue(parameterText: String, ruleset: Ruleset): Boolean {
if (parameterText == "City") return true // MapUnitFilter covers CivFilter
if (parameterText == "City") return true
if (MapUnitFilter.isKnownValue(parameterText, ruleset)) return true
if (CityFilter.isKnownValue(parameterText, ruleset)) return true
return false
}
},