mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-12 00:39:56 +07:00
Fixed policy branch finishers overriding branches - oops!
This commit is contained in:
@ -344,8 +344,8 @@ class Ruleset {
|
|||||||
if (policy.requires == null) {
|
if (policy.requires == null) {
|
||||||
policy.requires = arrayListOf(branch.name)
|
policy.requires = arrayListOf(branch.name)
|
||||||
}
|
}
|
||||||
policies[policy.name] = policy
|
|
||||||
|
|
||||||
|
if (policy != branch.policies.last()) {
|
||||||
// If mods override a previous policy's location, we don't want that policy to stick around,
|
// 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
|
// because it leads to softlocks on the policy picker screen
|
||||||
val conflictingLocationPolicy = policies.values.firstOrNull {
|
val conflictingLocationPolicy = policies.values.firstOrNull {
|
||||||
@ -353,9 +353,12 @@ class Ruleset {
|
|||||||
&& it.column == policy.column
|
&& it.column == policy.column
|
||||||
&& it.row == policy.row
|
&& it.row == policy.row
|
||||||
}
|
}
|
||||||
if (conflictingLocationPolicy!=null)
|
if (conflictingLocationPolicy != null)
|
||||||
policies.remove(conflictingLocationPolicy.name)
|
policies.remove(conflictingLocationPolicy.name)
|
||||||
}
|
}
|
||||||
|
policies[policy.name] = policy
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Add a finisher
|
// Add a finisher
|
||||||
branch.policies.last().name =
|
branch.policies.last().name =
|
||||||
|
Reference in New Issue
Block a user