From 7eb1364e362d13b1eaff83f4088227bdf2b9d069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 11 Nov 2023 07:58:10 +0100 Subject: [PATCH] catch games where specified draw pile is not feasible --- src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index d4a0557..b4374ad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,10 @@ namespace Hanabi { } game.forward_until(turn, draw_pile_size); + if (draw_pile_size != 0 and game.state->draw_pile_size() != static_cast(draw_pile_size)) { + std::cout << "This given draw pile size (" << draw_pile_size << ") cannot be obtained with the specified replay." << std::endl; + return; + } game.state->modify_clues(clue_modifier); if (not quiet) {