mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-13 12:27:40 +07:00
Fixed policy branch finishers overriding branches - oops!
This commit is contained in:
parent
35718c00e7
commit
e75742d3d6
@ -344,17 +344,20 @@ class Ruleset {
|
||||
if (policy.requires == null) {
|
||||
policy.requires = arrayListOf(branch.name)
|
||||
}
|
||||
|
||||
if (policy != branch.policies.last()) {
|
||||
// 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)
|
||||
}
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user