mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 07:16:54 +07:00
Added check for multiple policies with the same name - unlike techs buildings etc, these are also saved in the *policy branch* and so can affect gameplay
This commit is contained in:
parent
892fc1f936
commit
52f797c8e3
@ -745,6 +745,10 @@ class Ruleset {
|
||||
lines += "${policy.name} requires policy $prereq which does not exist!"
|
||||
checkUniques(policy, lines, rulesetSpecific, forOptionsPopup)
|
||||
}
|
||||
|
||||
for (policy in policyBranches.values.flatMap { it.policies + it })
|
||||
if (policy != policies[policy.name])
|
||||
lines += "More than one policy with the name ${policy.name} exists!"
|
||||
|
||||
for (reward in ruinRewards.values) {
|
||||
for (difficulty in reward.excludedDifficulties)
|
||||
@ -870,7 +874,8 @@ object RulesetCache : HashMap<String,Ruleset>() {
|
||||
val newRuleset = Ruleset()
|
||||
|
||||
val baseRuleset =
|
||||
if (containsKey(optionalBaseRuleset) && this[optionalBaseRuleset]!!.modOptions.isBaseRuleset) this[optionalBaseRuleset]!!
|
||||
if (containsKey(optionalBaseRuleset) && this[optionalBaseRuleset]!!.modOptions.isBaseRuleset)
|
||||
this[optionalBaseRuleset]!!
|
||||
else getVanillaRuleset()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user