Skip to content

Commit

Permalink
null check and 1 less patch
Browse files Browse the repository at this point in the history
  • Loading branch information
whichtwix committed Apr 27, 2024
1 parent 91a157f commit a76edfc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion source/Patches/CrewmateRoles/InvestigatorMod/AddPrints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static Vector2 Position(PlayerControl player)

public static void Postfix()
{
if (!GameManager.Instance.GameHasStarted || !PlayerControl.LocalPlayer.Is(RoleEnum.Investigator)) return;
if ((GameManager.Instance && !GameManager.Instance.GameHasStarted) || !PlayerControl.LocalPlayer.Is(RoleEnum.Investigator)) return;
if (MeetingHud.Instance) return;

// New Footprint
Expand Down
15 changes: 3 additions & 12 deletions source/Patches/CrewmateRoles/InvestigatorMod/EndGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,13 @@ public static void Reset()
}

[HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.ExitGame))]
public static class EndGamePatch
{
public static void Prefix(AmongUsClient __instance)
{
Reset();
}
}

[HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.Start))]
public static class EndGameManagerPatch

public static class EndGamePatch
{
public static bool Prefix(EndGameManager __instance)
public static void Prefix()
{
Reset();

return true;
}
}
}
Expand Down

0 comments on commit a76edfc

Please sign in to comment.