Skip to content

Commit

Permalink
v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisbison committed Nov 17, 2021
1 parent 40b9dfd commit c62ac89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 10 additions & 1 deletion TheOtherRoles/Patches/GameStartManagerPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class GameStartManagerPatch {
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) {
Expand All @@ -37,7 +46,7 @@ public class GameStartManagerUpdatePatch {
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;
}

Expand Down
3 changes: 0 additions & 3 deletions TheOtherRoles/RPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ public static void versionHandshake(int major, int minor, int build, int revisio
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) {
Expand Down

0 comments on commit c62ac89

Please sign in to comment.