Skip to content

Commit

Permalink
Fixed bug where forwarding the game to front after it is over changed…
Browse files Browse the repository at this point in the history
… the whosturn text at the bottom
  • Loading branch information
Naviary2 committed Dec 26, 2024
1 parent dc49351 commit 71794eb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/scripts/esm/game/gui/guigameinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import style from './style.js';
import game from '../chess/game.js';
import onlinegame from '../misc/onlinegame.js';
import winconutil from '../../chess/util/winconutil.js';
import gamefileutility from '../../chess/util/gamefileutility.js';
// Import End

/**
Expand Down Expand Up @@ -56,6 +57,10 @@ function revealPlayerNames(gameOptions) {
* @param {gamefile} gamefile - The gamefile
*/
function updateWhosTurn(gamefile) {
// In the scenario we forward the game to front after the game has adjudicated,
// don't modify the game over text saying who won!
if (gamefileutility.isGameOver(gamefile)) return;

const color = gamefile.whosTurn;

if (color !== 'white' && color !== 'black')
Expand Down

0 comments on commit 71794eb

Please sign in to comment.