mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 11:34:54 -04:00
Modding: Resolved #12299 - Allow removing free policies
This commit is contained in:
parent
0d19bf55e5
commit
1159c29f85
@ -258,9 +258,8 @@ class PolicyManager : IsPartOfGameInfoSerialization {
|
|||||||
if (!adoptedPolicies.remove(policy.name))
|
if (!adoptedPolicies.remove(policy.name))
|
||||||
throw IllegalStateException("Attempt to remove non-adopted Policy ${policy.name}")
|
throw IllegalStateException("Attempt to remove non-adopted Policy ${policy.name}")
|
||||||
|
|
||||||
if (!assumeWasFree) {
|
if (!assumeWasFree && numberOfAdoptedPolicies > 0) {
|
||||||
if (--numberOfAdoptedPolicies < 0)
|
numberOfAdoptedPolicies -= 1
|
||||||
throw IllegalStateException("Attempt to remove Policy ${policy.name} but civ only has free policies left")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
removePolicyFromTransients(policy)
|
removePolicyFromTransients(policy)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user