fixing errors

This commit is contained in:
Jonas Weinz 2019-03-22 08:59:41 +01:00
parent 200a4c99b4
commit a9429685ec
3 changed files with 8 additions and 5 deletions

View File

@ -90,7 +90,7 @@ class Grid
check_complete(sub_x, sub_y, x, y)
{
if (this.subgrids[sub_x][sub_y].is_won() || this.subgrids[sub_x][sub_y].is_draw())
if (this.subgrids[sub_y][sub_x].is_won() || this.subgrids[sub_y][sub_x].is_draw())
{
this.n_complete_subgrids++;
}

View File

@ -33,7 +33,7 @@ class LocalMatchManager
else if (grid.is_complete())
{
this.status_label.innerHTML = "Draw. Everybody looses!";
this.end_game();
this.end_game(false);
}
else
{
@ -59,9 +59,12 @@ class LocalMatchManager
this.grid.player_change_listener(next_player);
}
end_game()
end_game(closed_by_player = true)
{
this.status_label.innerHTML = "Game Over. Game Closed";
if (closed_by_player)
{
this.status_label.innerHTML = "Game Over. Game Closed";
}
this.grid.block_all();
}

View File

@ -64,7 +64,7 @@ class WebsocketConnection
this.relogin(session_id);
}
on_close()
on_close(login_failed=false)
{
var login_failed = !this.registered;
this.registered = false;