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
This commit is contained in:
Till Mayer 2020-03-12 23:08:56 +01:00 committed by Andreas Kling
parent 3e25c58755
commit de6f697eba
Notes: sideshowbarker 2024-07-19 08:20:04 +09:00

View file

@ -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);