From e602f2a41ad89a3f2bbc4612fc0d09465b074fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 14 Jun 2024 11:18:24 +0200 Subject: [PATCH] Add check for draw pile size --- include/game_state.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/game_state.hpp b/include/game_state.hpp index 9b3c6b6..92afe22 100644 --- a/include/game_state.hpp +++ b/include/game_state.hpp @@ -537,6 +537,12 @@ namespace Hanabi template void HanabiState::init_backtracking_information() { + if (_weighted_draw_pile_size > 20) + { + std::stringstream ss; + ss << "Detected draw pile size of " << +_weighted_draw_pile_size << " is too big, can at most be 20."; + throw std::runtime_error(ss.str()); + } ASSERT(not _relative_representation.initialized); // Note that this function does not have to be particularly performant, we only call it once to initialize. const Card trash = [this]() -> Card {