diff --git a/Managers/NetworkManager.cs b/Managers/NetworkManager.cs index 22abf45..39c5136 100644 --- a/Managers/NetworkManager.cs +++ b/Managers/NetworkManager.cs @@ -233,11 +233,11 @@ internal class NetworkManager if (Enum.IsDefined(typeof(RpcCalls), rpcCall)) { - innerNetObject.HandleRpc(rpcCall, reader); + innerNetObject?.HandleRpc(rpcCall, reader); } else { - if (innerNetObject is PlayerControl player) + if (innerNetObject is PlayerControl player && player != null) { RPC.HandleCustomRPC(player, rpcCall, reader); } diff --git a/ModInfo.cs b/ModInfo.cs index 23d9355..2967ec8 100644 --- a/ModInfo.cs +++ b/ModInfo.cs @@ -3,13 +3,13 @@ internal static class ModInfo { internal static readonly ReleaseTypes ReleaseBuildType = ReleaseTypes.Beta; - internal const string BetaNum = "1"; + internal const string BetaNum = "2"; internal const string HotfixNum = "0"; internal const bool IsHotFix = false; internal const string PluginName = "BetterAmongUs"; internal const string PluginGuid = "com.d1gq.betteramongus"; internal const string PluginVersion = "1.3.1"; - internal const string ReleaseDate = "12.04.2025"; // mm/dd/yyyy + internal const string ReleaseDate = "12.05.2025"; // mm/dd/yyyy internal const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; internal const string Discord = "https://discord.gg/vjYrXpzNAn"; } \ No newline at end of file diff --git a/Modules/GameState.cs b/Modules/GameState.cs index 19343eb..fecea9f 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -106,7 +106,7 @@ internal static class GameState internal static bool IsShip => ShipStatus.Instance != null; internal static bool IsHost => AmongUsClient.Instance != null && AmongUsClient.Instance.AmHost; internal static bool IsPrivateOnlyLobby => (BAUPlugin.PrivateOnlyLobby.Value || AmongUsClient.Instance.AmLocalHost) && IsHost; - internal static bool IsBetterHostLobby => PlayerControl.LocalPlayer.IsHost() || BAUPlugin.AllPlayerControls.Any(pc => pc.IsHost() && pc.BetterData().IsBetterUser && pc.BetterData().IsVerifiedBetterUser); + internal static bool IsBetterHostLobby => PlayerControl.LocalPlayer?.IsHost() == true || BAUPlugin.AllPlayerControls.Any(pc => pc?.BetterData() != null && pc.IsHost() && pc.BetterData().IsBetterUser && pc.BetterData().IsVerifiedBetterUser); internal static bool IsCanMove => PlayerControl.LocalPlayer?.CanMove is true; internal static bool IsDead => PlayerControl.LocalPlayer?.Data?.IsDead is true; } diff --git a/Patches/Client/PrivateLobbyPatch.cs b/Patches/Client/PrivateLobbyPatch.cs index ada2ee4..3723c4d 100644 --- a/Patches/Client/PrivateLobbyPatch.cs +++ b/Patches/Client/PrivateLobbyPatch.cs @@ -96,7 +96,7 @@ internal static class PrivateLobbyPatch var button = __instance.HostPrivateButton.GetComponent(); if (button != null) { - button.DestroyMono(); + button.enabled = false; var sprite = __instance.HostPrivateButton.transform.Find("Inactive").GetComponent(); if (sprite != null)