Skip to content

Commit

Permalink
Prevent joining the race room if the race has already started #196
Browse files Browse the repository at this point in the history
  • Loading branch information
neu5 committed Sep 15, 2023
1 parent 68cf6fc commit 3f98c23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/client/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ const startEngineLoop = ({ engine, playersMap, scene }: { engine: Engine, player
scene.dispose();
engine.stopRenderLoop();

if (isRaceStarted) {
game.ui.hideElement(game.elements.joinRaceRoomBtn);
game.ui.hideElement(game.elements.leaveRaceRoomBtn);
}

toggleStartRaceBtns(game.elements.startRaceBtn, !isRaceStarted);

const newScene = await startRace({
Expand Down

0 comments on commit 3f98c23

Please sign in to comment.