diff options
| -rw-r--r-- | src/main/solver/solver.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/solver/solver.cpp b/src/main/solver/solver.cpp index 3542383..9f0e1f3 100644 --- a/src/main/solver/solver.cpp +++ b/src/main/solver/solver.cpp @@ -48,10 +48,11 @@ bool solver::run() { bool is_new_state = cache.insert(state); if (is_new_state) { // Gets the legal moves in the current state - vector<game_state::move> next_moves = state.get_legal_moves(); + vector<game_state::move> next_moves = + state.get_legal_moves(); // If there are none, reverts to the last node with children - if (state.get_legal_moves().empty()) { + if (next_moves.empty()) { states_exhausted = revert_to_last_node_with_children(); } else { add_children(next_moves); |
