From cbe85c9e9821a7d5d3eda2d78d12ae7705b3cfed Mon Sep 17 00:00:00 2001 From: PHGaming121 <76562427+PHGaming121@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:13:08 -0300 Subject: [PATCH] bug fix from TOHE (#40) * Update en_US.json * update supported version * file 1 * file 2 * file 3 --- Patches/DiscordPatch.cs | 4 +++- Patches/GameStartManagerPatch.cs | 6 +++--- TOHE.csproj | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Patches/DiscordPatch.cs b/Patches/DiscordPatch.cs index aa527a588..29bc175b1 100644 --- a/Patches/DiscordPatch.cs +++ b/Patches/DiscordPatch.cs @@ -14,6 +14,8 @@ namespace TOHE.Patches public static void Prefix([HarmonyArgument(0)] Activity activity) { + if (activity == null) return; + var details = $"TOHE+ v{Main.PluginDisplayVersion}"; activity.Details = details; @@ -62,4 +64,4 @@ namespace TOHE.Patches } } } -} \ No newline at end of file +} diff --git a/Patches/GameStartManagerPatch.cs b/Patches/GameStartManagerPatch.cs index e6dd888bf..6e1ce4ab4 100644 --- a/Patches/GameStartManagerPatch.cs +++ b/Patches/GameStartManagerPatch.cs @@ -308,7 +308,7 @@ public class GameStartRandomMap Main.LastShapeshifterCooldown.Value = AURoleOptions.ShapeshifterCooldown; AURoleOptions.ShapeshifterCooldown = 0f; - PlayerControl.LocalPlayer.RpcSyncSettings(GameOptionsManager.Instance.gameOptionsFactory.ToBytes(opt)); + PlayerControl.LocalPlayer.RpcSyncSettings(GameOptionsManager.Instance.gameOptionsFactory.ToBytes(opt, AprilFoolsMode.IsAprilFoolsModeToggledOn)); __instance.ReallyBegin(false); return false; @@ -371,7 +371,7 @@ class ResetStartStatePatch if (GameStates.IsCountDown) { Main.NormalOptions.KillCooldown = Options.DefaultKillCooldown; - PlayerControl.LocalPlayer.RpcSyncSettings(GameOptionsManager.Instance.gameOptionsFactory.ToBytes(GameOptionsManager.Instance.CurrentGameOptions)); + PlayerControl.LocalPlayer.RpcSyncSettings(GameOptionsManager.Instance.gameOptionsFactory.ToBytes(GameOptionsManager.Instance.CurrentGameOptions, AprilFoolsMode.IsAprilFoolsModeToggledOn)); } } } @@ -384,4 +384,4 @@ class UnrestrictedNumImpostorsPatch __result = Main.NormalOptions.NumImpostors; return false; } -} \ No newline at end of file +} diff --git a/TOHE.csproj b/TOHE.csproj index e363db9f4..f5d12b02c 100644 --- a/TOHE.csproj +++ b/TOHE.csproj @@ -27,7 +27,7 @@ - +