Fix Starting Game in Private Lobby

This commit is contained in:
D1GQ committed 2025-12-05 15:01:43 -06:00
1 parent 286d3bd184
commit 636a449318
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -96,7 +96,7 @@ internal static class PrivateLobbyPatch
var button = __instance.HostPrivateButton.GetComponent<PassiveButton>();
if (button != null)
{
button.DestroyMono();
button.enabled = false;
var sprite = __instance.HostPrivateButton.transform.Find("Inactive").GetComponent<SpriteRenderer>();
if (sprite != null)