fix(game): ensure drawCount_ is reset in GameState::endGame

This commit is contained in:
Kieran Kihn
2025-12-17 23:37:25 +08:00
parent 5f11c609c1
commit 68ccfe2147
2 changed files with 1 additions and 1 deletions

View File

@@ -200,7 +200,6 @@ namespace UNO::GAME {
void ServerGameState::init()
{
this->drawCount_ = 0;
SPDLOG_INFO("Initializing server game state");
while (discardPile_.isEmpty() || discardPile_.getFront().getType() > CardType::NUM9) {
discardPile_.add(deck_.draw());

View File

@@ -297,6 +297,7 @@ namespace UNO::GAME {
template<PlayerStateTypeConcept PlayerStateType>
void GameState<PlayerStateType>::endGame()
{
drawCount_ = 0;
discardPile_.clear();
for (auto &player : this->players_) {
player.clear();