mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-13 01:08:25 +07:00
Fixed softlock for mod policies overriding existing policy locations
This commit is contained in:
@ -345,6 +345,16 @@ class Ruleset {
|
|||||||
policy.requires = arrayListOf(branch.name)
|
policy.requires = arrayListOf(branch.name)
|
||||||
}
|
}
|
||||||
policies[policy.name] = policy
|
policies[policy.name] = policy
|
||||||
|
|
||||||
|
// If mods override a previous policy's location, we don't want that policy to stick around,
|
||||||
|
// because it leads to softlocks on the policy picker screen
|
||||||
|
val conflictingLocationPolicy = policies.values.firstOrNull {
|
||||||
|
it.branch.name == policy.branch.name
|
||||||
|
&& it.column == policy.column
|
||||||
|
&& it.row == policy.row
|
||||||
|
}
|
||||||
|
if (conflictingLocationPolicy!=null)
|
||||||
|
policies.remove(conflictingLocationPolicy.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a finisher
|
// Add a finisher
|
||||||
|
Reference in New Issue
Block a user