Skip to content

Commit

Permalink
fix: max pieces updating to late
Browse files Browse the repository at this point in the history
  • Loading branch information
kacperwyczawski committed Aug 21, 2024
1 parent 5062359 commit 9580389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ function updateValue(element: HTMLElement, newValue: string) {

function renderGame() {
updateValue(q(`#${game.currentPlayer.color} .pieces`), game.currentPlayer.pieces.toString());
updateValue(q(`#${game.currentPlayer.color} .max-pieces`), game.currentPlayer.maxPieces.toString());
updateValue(q(`#${game.previousPlayer.color} .pieces`), game.previousPlayer.pieces.toString());
updateValue(q(`#${game.previousPlayer.color} .gold`), game.previousPlayer.gold.toString());
updateValue(q(`#${game.previousPlayer.color} .max-pieces`), game.previousPlayer.maxPieces.toString());

if (!firstRender) {
q("#player-buttons").classList.toggle("white");
Expand Down

0 comments on commit 9580389

Please sign in to comment.