Modding: Resolved #12299 - Allow removing free policies

This commit is contained in:
yairm210 2024-10-16 00:36:39 +03:00
parent 0d19bf55e5
commit 1159c29f85

View File

@ -258,9 +258,8 @@ class PolicyManager : IsPartOfGameInfoSerialization {
if (!adoptedPolicies.remove(policy.name))
throw IllegalStateException("Attempt to remove non-adopted Policy ${policy.name}")
if (!assumeWasFree) {
if (--numberOfAdoptedPolicies < 0)
throw IllegalStateException("Attempt to remove Policy ${policy.name} but civ only has free policies left")
if (!assumeWasFree && numberOfAdoptedPolicies > 0) {
numberOfAdoptedPolicies -= 1
}
removePolicyFromTransients(policy)