From: EoF-1141 <61620805+EoF-1141@users.noreply.github.com> Date: Fri, 16 Apr 2021 22:53:05 +0000 (+0200) Subject: Fix Files being in the wrong location X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=e336721091edbdaaba0474e3b589baddf231f263;p=rhonda%2Ftheotherroles.git Fix Files being in the wrong location --- diff --git a/Source Code/EndGamePatch.cs b/Source Code/EndGamePatch.cs index dc1da14..72cfff8 100644 --- a/Source Code/EndGamePatch.cs +++ b/Source Code/EndGamePatch.cs @@ -199,10 +199,11 @@ namespace TheOtherRoles { } [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.KMPKPPGPNIH))] - class CheckEndCriteriaPatch{ - + class CheckEndCriteriaPatch { public static bool Prefix(ShipStatus __instance) { if (!GameData.Instance) return false; + if (FreePlayFix.isInFreePlay) // if (__instance.DummyLocations != null && __instance.DummyLocations.Count > 0) + return true; // I don't know how to get from ShipStatus GameModes.FreePlay var statistics = new PlayerStatistics(__instance); if (CheckAndEndGameForChildLose(__instance)) return false; if (CheckAndEndGameForJesterWin(__instance)) return false; diff --git a/Source Code/FreePlayFix.cs b/Source Code/FreePlayFix.cs new file mode 100644 index 0000000..816f762 --- /dev/null +++ b/Source Code/FreePlayFix.cs @@ -0,0 +1,20 @@ +using System; +using System.Linq; +using HarmonyLib; +using UnityEngine; + +namespace TheOtherRoles { + [HarmonyPatch] + public static class FreePlayFix { + public static bool isInFreePlay = false; + + [HarmonyPatch(typeof(ShipStatus), nameof(ShipStatus.Begin))] + public static class ShipStatusBeginPatch { + public static void Prefix(ShipStatus __instance) { + System.Console.WriteLine("Begin"); + isInFreePlay = UnityEngine.Object.FindObjectsOfType().ToList() + .Find(console => console.name == "TaskAddConsole"); + } + } + } +} \ No newline at end of file