fix: two-player lobby deadlock
This commit is contained in:
+2
-3
@@ -549,7 +549,7 @@
|
||||
ui.modeControls.hidden = !playerOne;
|
||||
if (playerOne) startLobbyInfoPolling();
|
||||
else stopLobbyInfoPolling();
|
||||
const playerTwoReady = info?.player2Available === false;
|
||||
const playerTwoReady = state.players[1].trim() !== '' || info?.player2Available === false;
|
||||
const canStart = playerOne && (state.mode === 'bot' || playerTwoReady);
|
||||
setSpriteIcon(ui.lobbyIcon, canStart ? 'icon-check' : 'icon-hourglass');
|
||||
document.querySelectorAll('.mode-button').forEach(button => {
|
||||
@@ -673,8 +673,7 @@
|
||||
|
||||
el('join-form').addEventListener('submit', event => {
|
||||
event.preventDefault();
|
||||
const requestedRole = info?.player1Available ? 'player1' : info?.player2Available ? 'player2' : 'spectator';
|
||||
join(requestedRole);
|
||||
join('player');
|
||||
});
|
||||
document.querySelectorAll('.avatar-button').forEach(button => button.addEventListener('click', () => {
|
||||
ui.name.value = button.dataset.name;
|
||||
|
||||
Reference in New Issue
Block a user