From c62ac89b079b51e7d94cc98249c7d17bd5e63ccb Mon Sep 17 00:00:00 2001 From: Eisbison Date: Wed, 17 Nov 2021 12:25:17 +0100 Subject: [PATCH] v3.1.0 --- TheOtherRoles/Patches/GameStartManagerPatch.cs | 11 ++++++++++- TheOtherRoles/RPC.cs | 3 --- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/TheOtherRoles/Patches/GameStartManagerPatch.cs b/TheOtherRoles/Patches/GameStartManagerPatch.cs index 21ed43b..8375a9f 100644 --- a/TheOtherRoles/Patches/GameStartManagerPatch.cs +++ b/TheOtherRoles/Patches/GameStartManagerPatch.cs @@ -15,6 +15,15 @@ namespace TheOtherRoles.Patches { private static bool versionSent = false; private static string lobbyCodeText = ""; + [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnPlayerJoined))] + public class AmongUsClientOnPlayerJoinedPatch { + public static void Postfix() { + if (PlayerControl.LocalPlayer != null) { + Helpers.shareGameVersion(); + } + } + } + [HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))] public class GameStartManagerStartPatch { public static void Postfix(GameStartManager __instance) { @@ -37,7 +46,7 @@ namespace TheOtherRoles.Patches { private static string currentText = ""; public static void Prefix(GameStartManager __instance) { - if (!AmongUsClient.Instance.AmHost || !GameData.Instance) return; // Not host or no instance + if (!AmongUsClient.Instance.AmHost || !GameData.Instance ) return; // Not host or no instance update = GameData.Instance.PlayerCount != __instance.LastPlayerCount; } diff --git a/TheOtherRoles/RPC.cs b/TheOtherRoles/RPC.cs index df4edfa..da0013c 100644 --- a/TheOtherRoles/RPC.cs +++ b/TheOtherRoles/RPC.cs @@ -253,9 +253,6 @@ namespace TheOtherRoles else ver = new System.Version(major, minor, build, revision); GameStartManagerPatch.playerVersions[clientId] = new GameStartManagerPatch.PlayerVersion(ver, guid); - - if (AmongUsClient.Instance.AmHost && clientId != AmongUsClient.Instance.ClientId) // Host returns version whenever another player sends one - Helpers.shareGameVersion(); } public static void useUncheckedVent(int ventId, byte playerId, byte isEnter) { -- 2.39.5