summaryrefslogtreecommitdiff
path: root/Userland/Games/Spider
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-09-28 17:47:19 +0100
committerSam Atkins <atkinssj@gmail.com>2022-10-10 16:16:01 +0100
commit5186e617bd231acaacf970cb289450de03ef86aa (patch)
tree6fbf0106e1d030aeb10c4d4b0d9874435c791cc1 /Userland/Games/Spider
parentef8b1e25aa7ed30e71d0cae46ba5da55345fe181 (diff)
downloadserenity-5186e617bd231acaacf970cb289450de03ef86aa.zip
LibCards+Games: Remove concept of a CardStack being focused
This was only used for asking the stack if it is the one we are moving cards from. We now have a better way to do that, by comparing against `CardGame::moving_cards_source_stack()`, which doesn't require manually telling a stack that it is/isn't focused.
Diffstat (limited to 'Userland/Games/Spider')
-rw-r--r--Userland/Games/Spider/Game.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Games/Spider/Game.cpp b/Userland/Games/Spider/Game.cpp
index 6e1dd748d9..af6c65ac47 100644
--- a/Userland/Games/Spider/Game.cpp
+++ b/Userland/Games/Spider/Game.cpp
@@ -257,7 +257,7 @@ void Game::mouseup_event(GUI::MouseEvent& event)
// This enables the game to move the focused cards to the first possible stack excluding empty stacks.
// NOTE: This ignores empty stacks, as the game has no undo button, and a card, which has been moved to an empty stack without any other possibilities is not reversible.
for (auto& stack : stacks()) {
- if (stack.is_focused())
+ if (stack == moving_cards_source_stack())
continue;
if (stack.is_allowed_to_push(moving_cards().at(0), moving_cards().size(), Cards::CardStack::MovementRule::Any) && !stack.is_empty()) {