From 27972117db0feafd481d1a6907ef93752cd2226c Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Fri, 23 Feb 2018 21:26:31 +0000 Subject: Fix double call to gen legal moves in solver --- src/main/solver/solver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/solver/solver.cpp') 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 next_moves = state.get_legal_moves(); + vector 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); -- cgit v1.2.1