diff --git a/game_state.hpp b/game_state.hpp index 197ea40..f4f66d2 100644 --- a/game_state.hpp +++ b/game_state.hpp @@ -144,8 +144,8 @@ namespace Hanabi { _card_positions[_hands[_turn][index]] = draw_pile; - // draw a new card if the draw pile is not empty - if (_draw_pile.back().card == _hands[_turn][index]) { + // put card back into draw pile (at the back) + if (!_draw_pile.empty() and _draw_pile.back().card == _hands[_turn][index]) { _draw_pile.back().multiplicity++; } else { _draw_pile.push_back({_hands[_turn][index], 1}); diff --git a/main.cpp b/main.cpp index 1d6aece..9654795 100644 --- a/main.cpp +++ b/main.cpp @@ -54,7 +54,7 @@ void print_sizes() { } int main() { -// Hanabi::test_game(); + Hanabi::test_game(); Hanabi::download(); return 0;