]> git.deb.at Git - rhonda/theotherroles.git/commitdiff
v3.1.0
authorEisbison <eisbison.creator@gmail.com>
Wed, 17 Nov 2021 11:25:17 +0000 (12:25 +0100)
committerEisbison <eisbison.creator@gmail.com>
Wed, 17 Nov 2021 11:25:17 +0000 (12:25 +0100)
TheOtherRoles/Patches/GameStartManagerPatch.cs
TheOtherRoles/RPC.cs

index 21ed43b34c6b39f65c51f7e075508f1417187fe1..8375a9fc1760b9f4f99c6f79154d0381b3a06a4e 100644 (file)
@@ -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;
             }
 
index df4edfa80bbe19d8e91cc950c503153d006c8ca8..da0013c18b27d6c71d65f8dcb33121885a621d9d 100644 (file)
@@ -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) {