mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 15:27:27 +07:00
Added ruleset warnings for empty ally and friend bonuses
We currently use the defaults, but we should phase that out
This commit is contained in:
parent
8c4bc2927c
commit
0ac2c932f6
@ -50,6 +50,7 @@ class Era : RulesetObject(), IHasUniques {
|
||||
}
|
||||
}
|
||||
|
||||
/** Since 3.19.5 we have a warning for mods without bonuses, eventually we should treat such mods as providing no bonus */
|
||||
fun undefinedCityStateBonuses(): Boolean {
|
||||
return friendBonus.isEmpty() || allyBonus.isEmpty()
|
||||
}
|
||||
|
@ -628,6 +628,7 @@ class Ruleset {
|
||||
allDifficultiesStartingUnits.addAll(difficulty.playerBonusStartingUnits)
|
||||
}
|
||||
|
||||
val rulesetHasCityStates = nations.values.any { it.isCityState() }
|
||||
for (era in eras.values) {
|
||||
for (wonder in era.startingObsoleteWonders)
|
||||
if (wonder !in buildings)
|
||||
@ -647,6 +648,13 @@ class Ruleset {
|
||||
lines += "Unexpected negative number found while parsing era ${era.name}"
|
||||
if (era.settlerPopulation <= 0)
|
||||
lines += "Population in cities from settlers must be strictly positive! Found value ${era.settlerPopulation} for era ${era.name}"
|
||||
|
||||
if (era.allyBonus.isEmpty() && rulesetHasCityStates)
|
||||
lines.add("No ally bonus defined for era ${era.name}", RulesetErrorSeverity.Warning)
|
||||
if (era.friendBonus.isEmpty() && rulesetHasCityStates)
|
||||
lines.add("No friend bonus defined for era ${era.name}", RulesetErrorSeverity.Warning)
|
||||
|
||||
|
||||
checkUniques(era, lines, UniqueType.UniqueComplianceErrorSeverity.RulesetSpecific)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user