Skip to content

Commit

Permalink
Fix crash after leaving village after waiting or clicking leave too f…
Browse files Browse the repository at this point in the history
…ast two times
  • Loading branch information
georgyrudnev committed Nov 11, 2024
1 parent 5071b66 commit a2b414d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public class LeaveSettlementActionPatches
[HarmonyPatch(nameof(LeaveSettlementAction.ApplyForParty))]
private static bool Prefix(MobileParty mobileParty)
{
if(CallOriginalPolicy.IsOriginalAllowed()) return true;
if (mobileParty.CurrentSettlement == null) return false;
if (CallOriginalPolicy.IsOriginalAllowed()) return true;

if (ModInformation.IsClient) return false;

Expand All @@ -37,7 +38,7 @@ public static void OverrideApplyForParty(MobileParty party)
{
using (new AllowedThread())
{
LeaveSettlementAction.ApplyForParty(party);
if (party.CurrentSettlement != null) LeaveSettlementAction.ApplyForParty(party);
}
}, blocking: true);
}
Expand Down

0 comments on commit a2b414d

Please sign in to comment.