mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -04:00
Allow BaseUnit unique functions to return UnitType uniques
Resolves #9135
This commit is contained in:
parent
5568cc08c0
commit
f8137b8a52
@ -106,6 +106,15 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
|
||||
return unit
|
||||
}
|
||||
|
||||
/** Allows unique functions (getMatchingUniques, hasUnique) to "see" uniques from the UnitType */
|
||||
override fun getMatchingUniques(uniqueType: UniqueType, stateForConditionals: StateForConditionals?): Sequence<Unique> {
|
||||
val ourUniques = super<RulesetObject>.getMatchingUniques(uniqueType, stateForConditionals)
|
||||
if (! ::ruleset.isInitialized) { // Not sure if this will ever actually happen, but better safe than sorry
|
||||
return ourUniques
|
||||
}
|
||||
return ourUniques + type.getMatchingUniques(uniqueType, stateForConditionals)
|
||||
}
|
||||
|
||||
override fun getProductionCost(civInfo: Civilization): Int = costFunctions.getProductionCost(civInfo)
|
||||
|
||||
override fun canBePurchasedWithStat(city: City?, stat: Stat): Boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user