File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Assets/BossRoom/Scripts/Server/Game/State Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ void CancelCloseLobby()
134
134
StopCoroutine ( m_WaitToEndLobbyCoroutine ) ;
135
135
}
136
136
CharSelectData . IsLobbyClosed . Value = false ;
137
+ // Set all players unready so they can react to this cancellation
138
+ SetAllUnready ( ) ;
139
+ }
140
+
141
+ void SetAllUnready ( )
142
+ {
137
143
for ( int i = 0 ; i < CharSelectData . LobbyPlayers . Count ; ++ i )
138
144
{
139
145
// Set all locked players to active so that they have to confirm their choice again
@@ -272,11 +278,18 @@ void OnClientDisconnectCallback(ulong clientId)
272
278
}
273
279
}
274
280
275
- // If lobby is closing and waiting to start the game, cancel so that other players can react to it
281
+
276
282
if ( CharSelectData . IsLobbyClosed . Value )
277
283
{
284
+ // If lobby is closing and waiting to start the game, cancel so that other players can react to it, and
285
+ // wait for the player coming back if they want to.
278
286
CancelCloseLobby ( ) ;
279
287
}
288
+ else
289
+ {
290
+ // If it is not closing, set everyone as unready for the same reason
291
+ SetAllUnready ( ) ;
292
+ }
280
293
}
281
294
}
282
295
}
You can’t perform that action at this time.
0 commit comments