From de6f697ebabfbe998ef2fcb16817131f8a796a0e Mon Sep 17 00:00:00 2001 From: Till Mayer Date: Thu, 12 Mar 2020 23:08:56 +0100 Subject: Solitaire: Fix automatic moving of cards A previous change trying to fix an assertion error completely broke the automatic moving of cards, this commit will fix this problem --- Games/Solitaire/SolitaireWidget.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Games') diff --git a/Games/Solitaire/SolitaireWidget.cpp b/Games/Solitaire/SolitaireWidget.cpp index b3747a02dd..3ec581d617 100644 --- a/Games/Solitaire/SolitaireWidget.cpp +++ b/Games/Solitaire/SolitaireWidget.cpp @@ -312,12 +312,9 @@ void SolitaireWidget::doubleclick_event(GUI::MouseEvent& event) return; } - if (!m_focused_cards.is_empty()) - return; - auto click_location = event.position(); for (auto& to_check : m_stacks) { - if (to_check.type() == CardStack::Type::Foundation) + if (to_check.type() == CardStack::Type::Foundation || to_check.type() == CardStack::Type::Stock) continue; if (to_check.bounding_box().contains(click_location) && !to_check.is_empty()) { @@ -360,6 +357,7 @@ void SolitaireWidget::move_card(CardStack& from, CardStack& to) auto card = from.pop(); card->set_moving(true); + m_focused_cards.clear(); m_focused_cards.append(card); mark_intersecting_stacks_dirty(card); to.push(card); -- cgit v1.2.3