diff --git a/src/client/graphics/layers/OptionsMenu.ts b/src/client/graphics/layers/OptionsMenu.ts index 2e07e1e30..32d07727a 100644 --- a/src/client/graphics/layers/OptionsMenu.ts +++ b/src/client/graphics/layers/OptionsMenu.ts @@ -52,11 +52,13 @@ export class OptionsMenu extends LitElement implements Layer { private hasWinner = false; private onExitButtonClick() { - const isConfirmed = confirm("Are you sure you want to exit the game?"); - - if (isConfirmed) { - window.location.reload(); + const isAlive = this.game.myPlayer()?.isAlive(); + if (isAlive) { + const isConfirmed = confirm("Are you sure you want to exit the game?"); + if (!isConfirmed) return; } + + window.location.reload(); } createRenderRoot() {