yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.32k stars 1.56k forks source link

Patronage policy bug #4181

Closed AdityaMH closed 3 years ago

AdityaMH commented 3 years ago

Every time i choose patronage, always going to crash instantly. And my save game data lead to corrupted. (Maybe because from rekMod)

About save data: sorry, i can't upload to github because github system bug. Maybe i will upload to discord.

xlenstra commented 3 years ago

Patronage isn't in the main game (yet), so this is a mod issue

ravignir commented 3 years ago

give me more info, which policy causes the issue?

AdityaMH commented 3 years ago

Just choose patronage policy, then end turn. Instantly crashed and sometimes my save data lead to corrupted.

Not all crashed problem cause by mod is from mod itself. But because missing or removed some unciv base data on lastest version. Just like #3918

Before version 3.15.0, never cause problem, run normally.

AdityaMH commented 3 years ago

That's weird, everytime i choose patronage always lead to crashed. But sometimes i can resume the game, sometime my save data corrupted.

ravignir commented 3 years ago

if (!ruleSet.policies.containsKey(policy) && !(policy == "Entrepreneurship" || policy == "Patronage")) civinfo.policies.adoptedPolicies.remove(policy) I believe this causes the crash.

xlenstra commented 3 years ago

I think this part may also play a role (from in the policymanager class)

            if (adoptedPolicies.contains("Patronage")) {
                adoptedPolicies.add("Merchant Navy")
                adoptedPolicies.remove("Patronage")
            }
            if (adoptedPolicies.contains("Entrepreneurship")) {
                adoptedPolicies.add("Naval Tradition")
                adoptedPolicies.remove("Entrepreneurship")
            }
ravignir commented 3 years ago

yes, you are right, the one i posted just "unpicks" the policy as soon as it is adopted, the one you posted tries to replace it with a policy that does not exist.

ravignir commented 3 years ago

close?