UnitFilter also matches TechFilter for that unit

This commit is contained in:
Yair Morgenstern 2023-06-12 23:13:47 +03:00
parent 624eefccab
commit 02d7325576
2 changed files with 3 additions and 0 deletions

View File

@ -301,8 +301,10 @@ class BaseUnit : RulesetObject(), INonPerpetualConstruction {
"Nuclear Weapon" -> isNuclearWeapon()
"Great Person" -> isGreatPerson()
"Religious" -> hasUnique(UniqueType.ReligiousUnit)
else -> {
if (type.matchesFilter(filter)) return true
if (requiredTech != null && ruleset.technologies[requiredTech]?.matchesFilter(filter)==true) return true
if (
// Uniques using these kinds of filters should be deprecated and replaced with adjective-only parameters
filter.endsWith(" units")

View File

@ -41,6 +41,7 @@ The following are allowed to be used:
- `Nuclear Weapon`
- `Great Person`, `Great`
- `Embarked`
- Matching [technologyfilter](#technologyfilter) for the tech this unit requires - e.g. `Modern Era`
- Any exact unique the unit has
- Any exact unique the unit type has
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `[{Military} {Water}]` units, `[{non-air} {Armor}]` units, etc. No space or other text is allowed between the `[` and the first `{`.