diff options
Diffstat (limited to 'src/main/game/game_state.legal_moves.cpp')
| -rw-r--r-- | src/main/game/game_state.legal_moves.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/game/game_state.legal_moves.cpp b/src/main/game/game_state.legal_moves.cpp index 99431e3..1d9b94f 100644 --- a/src/main/game/game_state.legal_moves.cpp +++ b/src/main/game/game_state.legal_moves.cpp @@ -21,9 +21,19 @@ vector<game_state::move> game_state::get_legal_moves( // The next legal moves vector<move> moves; - // If we have a stock that can deal to the tableau piles, add this move + // If we have a stock that can deal to the tableau piles, adds this move if (rules.stock_deal_t == sdt::TABLEAU_PILES && !piles[stock].empty()) { - moves.emplace_back(get_stock_tableau_move()); + // Only does this if all the tableau piles are empty + bool no_tableau_empty = true; + for (auto tab_ref : tableau_piles) { + if (piles[tab_ref].empty()) { + no_tableau_empty = false; + break; + } + } + if (no_tableau_empty) { + moves.emplace_back(get_stock_tableau_move()); + } } // Cycles through each pile which we may be able to remove a card from |
