Added check for belief.type (#10711)

* Added check for belief.type

* Removed check for BeliefType.None

Not needed if check beforehand checks for it

* Update RulesetValidator.kt

* Update Belief.kt

* Update Belief.kt
This commit is contained in:
Why-not-now 2023-12-14 04:35:51 +08:00 committed by GitHub
parent 9c4ba059ca
commit 16893ced68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import com.unciv.json.fromJsonFile
import com.unciv.json.json
import com.unciv.logic.map.tile.RoadStatus
import com.unciv.models.metadata.BaseRuleset
import com.unciv.models.ruleset.BeliefType
import com.unciv.models.ruleset.Building
import com.unciv.models.ruleset.Ruleset
import com.unciv.models.ruleset.RulesetCache
@ -230,6 +231,8 @@ class RulesetValidator(val ruleset: Ruleset) {
tryFixUnknownUniques: Boolean
) {
for (belief in ruleset.beliefs.values) {
if (belief.type == BeliefType.Any || belief.type == BeliefType.None)
lines += "${belief.name} type is {belief.type}, which is not allowed!"
uniqueValidator.checkUniques(belief, lines, true, tryFixUnknownUniques)
}
}