diff --git a/src/game/GameState.h b/src/game/GameState.h index 0e967dc..c9ade2a 100644 --- a/src/game/GameState.h +++ b/src/game/GameState.h @@ -195,7 +195,9 @@ namespace UNO::GAME { template void GameState::addPlayer(PlayerStateType playerState) { - this->currentPlayer_ = this->players_.push_back(std::move(playerState), this->currentPlayer_); + int currentPlayerIndex = this->currentPlayer_ - this->players_.begin(); + this->players_.push_back(std::move(playerState)); + this->currentPlayer_ = this->players_.begin() + currentPlayerIndex; } template