mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 02:13:18 +08:00
fix(game): ensure drawCount_ is reset in GameState::endGame
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user