summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCards
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibCards')
-rw-r--r--Userland/Libraries/LibCards/CardGame.cpp6
-rw-r--r--Userland/Libraries/LibCards/CardGame.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/Userland/Libraries/LibCards/CardGame.cpp b/Userland/Libraries/LibCards/CardGame.cpp
index ad1a8e6a0b..a863128709 100644
--- a/Userland/Libraries/LibCards/CardGame.cpp
+++ b/Userland/Libraries/LibCards/CardGame.cpp
@@ -83,17 +83,19 @@ RefPtr<CardStack> CardGame::find_stack_to_drop_on(CardStack::MovementRule moveme
return closest_stack;
}
-void CardGame::drop_cards_on_stack(Cards::CardStack& stack, CardStack::MovementRule movement_rule)
+ErrorOr<void> CardGame::drop_cards_on_stack(Cards::CardStack& stack, CardStack::MovementRule movement_rule)
{
VERIFY(stack.is_allowed_to_push(m_moving_cards.at(0), m_moving_cards.size(), movement_rule));
for (auto& to_intersect : moving_cards()) {
mark_intersecting_stacks_dirty(to_intersect);
- stack.push(to_intersect).release_value_but_fixme_should_propagate_errors();
+ TRY(stack.push(to_intersect));
(void)moving_cards_source_stack()->pop();
}
update(moving_cards_source_stack()->bounding_box());
update(stack.bounding_box());
+
+ return {};
}
void CardGame::clear_moving_cards()
diff --git a/Userland/Libraries/LibCards/CardGame.h b/Userland/Libraries/LibCards/CardGame.h
index d199471fff..d6d60e04c2 100644
--- a/Userland/Libraries/LibCards/CardGame.h
+++ b/Userland/Libraries/LibCards/CardGame.h
@@ -44,7 +44,7 @@ public:
RefPtr<CardStack> moving_cards_source_stack() const { return m_moving_cards_source_stack; }
void pick_up_cards_from_stack(CardStack&, Gfx::IntPoint click_location, CardStack::MovementRule);
RefPtr<CardStack> find_stack_to_drop_on(CardStack::MovementRule) const;
- void drop_cards_on_stack(CardStack&, CardStack::MovementRule);
+ ErrorOr<void> drop_cards_on_stack(CardStack&, CardStack::MovementRule);
void clear_moving_cards();
bool is_previewing_card() const { return !m_previewed_card_stack.is_null(); }