From 586098b3cf1cd66c8da1267afaaeedd53de4c7af Mon Sep 17 00:00:00 2001 From: LadyEbony Date: Fri, 21 Aug 2020 23:07:08 -0700 Subject: [PATCH] whoops i write bad code --- Assets/Code/Networking/NetProperties/PlayerProperties.cs | 5 +---- Assets/RealCode/Menu/GameTransition.cs | 3 ++- Assets/RealCode/Menu/LobbySetup.cs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Assets/Code/Networking/NetProperties/PlayerProperties.cs b/Assets/Code/Networking/NetProperties/PlayerProperties.cs index a6795cc..2f1e1e7 100644 --- a/Assets/Code/Networking/NetProperties/PlayerProperties.cs +++ b/Assets/Code/Networking/NetProperties/PlayerProperties.cs @@ -186,11 +186,8 @@ public static class PlayerProperties { if (players.Count < 2) return false; - var hashset = new HashSet(); foreach(var p in players){ - var pid = playerCharacter.Get(p); - if (pid == -1) return false; - if (!hashset.Add(pid)) return false; + if (!lobbyStatus.Get(p)) return false; } return true; } diff --git a/Assets/RealCode/Menu/GameTransition.cs b/Assets/RealCode/Menu/GameTransition.cs index 8287062..2585e2d 100644 --- a/Assets/RealCode/Menu/GameTransition.cs +++ b/Assets/RealCode/Menu/GameTransition.cs @@ -113,7 +113,8 @@ public class GameTransition : MonoBehaviour { state = GameState.Multiplayer; break; case ExitGames.Client.Photon.LoadBalancing.ClientState.Joined: - state = GameState.Lobby; + if (state != GameState.InGame && state != GameState.Continue) + state = GameState.Lobby; break; } } diff --git a/Assets/RealCode/Menu/LobbySetup.cs b/Assets/RealCode/Menu/LobbySetup.cs index 7d659c4..f41d180 100644 --- a/Assets/RealCode/Menu/LobbySetup.cs +++ b/Assets/RealCode/Menu/LobbySetup.cs @@ -57,7 +57,7 @@ public class LobbySetup : MonoBehaviour { PlayerProperties.playerCharacter.SetLocal(1); GameBoardInstance.instance.player2.authorityID = p2.ID; } - var pready = PlayerProperties.lobbyStatus.Get(p1); + var pready = PlayerProperties.lobbyStatus.Get(p2); readyCheck2.localRotation = Quaternion.RotateTowards(readyCheck1.localRotation, pready ? Quaternion.identity : Quaternion.Euler(0f, 0f, 45f), delta); readyImage2.color = pready ? Color.green : Color.red; } else {