From 3d2f7ab043c63d321021735df4f9f4a0232695b0 Mon Sep 17 00:00:00 2001 From: donZappo <40925542+donZappo@users.noreply.github.com> Date: Tue, 4 Sep 2018 02:55:59 -0400 Subject: [PATCH] Fixed bug with Criminal. --- Pilot_Quirks.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Pilot_Quirks.cs b/Pilot_Quirks.cs index cabaf62..8aa8374 100644 --- a/Pilot_Quirks.cs +++ b/Pilot_Quirks.cs @@ -292,9 +292,16 @@ public static void Postfix(SimGameState __instance) } } + bool honest = false; foreach (Pilot pilot in __instance.PilotRoster) { - if (pilot.pilotDef.PilotTags.Contains("pilot_criminal")) + if (pilot.pilotDef.PilotTags.Contains("pilot_honest")) + honest = true; + } + + foreach (Pilot pilot in __instance.PilotRoster) + { + if (pilot.pilotDef.PilotTags.Contains("pilot_criminal") && !honest) { var rng = new System.Random(); int Roll = rng.Next(1, 101); @@ -368,15 +375,9 @@ public static void Prefix(Shop __instance, int max) SimGameState Sim = Traverse.Create(__instance).Field("Sim").GetValue(); if (Sim.CurSystem.Tags.Contains("planet_other_blackmarket")) { - bool honest = false; - foreach (Pilot pilot in Sim.PilotRoster) - { - if (pilot.pilotDef.PilotTags.Contains("pilot_honest")) - honest = true; - } foreach (Pilot pilot in Sim.PilotRoster) { - if (pilot.pilotDef.PilotTags.Contains("pilot_criminal") && !honest) + if (pilot.pilotDef.PilotTags.Contains("pilot_criminal")) max = max + 2; } }