@@ -135,26 +135,6 @@ void CancelCloseLobby()
135135 StopCoroutine ( m_WaitToEndLobbyCoroutine ) ;
136136 }
137137 CharSelectData . IsLobbyClosed . Value = false ;
138- // Set all players unready so they can react to this cancellation
139- SetAllUnready ( ) ;
140- }
141-
142- void SetAllUnready ( )
143- {
144- for ( int i = 0 ; i < CharSelectData . LobbyPlayers . Count ; ++ i )
145- {
146- // Set all locked players to active so that they have to confirm their choice again
147- if ( CharSelectData . LobbyPlayers [ i ] . SeatState == CharSelectData . SeatState . LockedIn )
148- {
149- CharSelectData . LobbyPlayers [ i ] = new CharSelectData . LobbyPlayerState (
150- CharSelectData . LobbyPlayers [ i ] . ClientId ,
151- CharSelectData . LobbyPlayers [ i ] . PlayerName ,
152- CharSelectData . LobbyPlayers [ i ] . PlayerNumber ,
153- CharSelectData . SeatState . Active ,
154- CharSelectData . LobbyPlayers [ i ] . SeatIdx ,
155- CharSelectData . LobbyPlayers [ i ] . LastChangeTime ) ;
156- }
157- }
158138 }
159139
160140 void SaveLobbyResults ( )
@@ -283,17 +263,10 @@ void OnClientDisconnectCallback(ulong clientId)
283263 }
284264 }
285265
286-
287- if ( CharSelectData . IsLobbyClosed . Value )
288- {
289- // If lobby is closing and waiting to start the game, cancel so that other players can react to it, and
290- // wait for the player coming back if they want to.
291- CancelCloseLobby ( ) ;
292- }
293- else
266+ if ( ! CharSelectData . IsLobbyClosed . Value )
294267 {
295- // If it is not closing, set everyone as unready for the same reason
296- SetAllUnready ( ) ;
268+ // If the lobby is not already closing, close if the remaining players are all ready
269+ CloseLobbyIfReady ( ) ;
297270 }
298271 }
299272 }
0 commit comments