From d074feaaa0761c6104cfd0934dfcb3eda18adb47 Mon Sep 17 00:00:00 2001 From: Kieran Kihn <114803508+kierankihn@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:58:34 +0800 Subject: [PATCH] fix(game): update `updateStateByDraw` to correctly adjust player's card count --- src/game/GameState.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/GameState.h b/src/game/GameState.h index 394721a..983ac96 100644 --- a/src/game/GameState.h +++ b/src/game/GameState.h @@ -256,9 +256,14 @@ namespace UNO::GAME { template void GameState::updateStateByDraw() { - if (this->drawCount_ != 0) { - this->drawCount_ = 0; + if (this->drawCount_ == 0) { + this->currentPlayer_->setRemainingCardCount(this->currentPlayer_->getRemainingCardCount() + 1); } + else { + this->currentPlayer_->setRemainingCardCount((this->currentPlayer_->getRemainingCardCount() + this->drawCount_)); + } + this->drawCount_ = 0; + this->nextPlayer(); } class ClientGameState final : public GameState {