fix bug with transferring mod powers to spectators that join after game is started

This commit is contained in:
AlecM33
2022-02-24 23:09:25 -05:00
parent 84754d6101
commit 740813f05c
5 changed files with 65 additions and 2 deletions

View File

@@ -157,6 +157,10 @@ function setClientSocketHandlers (stateBucket, gameStateRenderer, socket, timerW
}
});
socket.on(globals.EVENTS.NEW_SPECTATOR, (spectator) => {
stateBucket.currentGameState.spectators.push(spectator);
});
socket.on(globals.EVENTS.PLAYER_LEFT, (player) => {
removeStartGameFunctionalityIfPresent(gameStateRenderer);
toast(player.name + ' has left!', 'error', false, true, 3);