From 76f7196de373778d3a24323ef0cbf386e3a03e6f Mon Sep 17 00:00:00 2001 From: mojsior Date: Mon, 9 Feb 2026 16:41:29 +0100 Subject: [PATCH] access: toggle stash focus based on cursor --- Source/controls/plrctrls.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 36e630f0b..99d044303 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -2276,8 +2276,12 @@ void ToggleStashFocus() const Item &holdItem = MyPlayer->HoldItem; - // If currently focused on inventory/belt, jump to stash. Otherwise jump back to inventory. - if (Slot >= 0) { + // Toggle based on cursor location rather than `Slot`, as `Slot` gets invalidated on mouse move in + // keyboard+mouse mode (which would otherwise prevent reaching the stash). + const bool cursorOnStash = GetLeftPanel().contains(MousePosition); + + // If currently on inventory/belt (or elsewhere), jump to stash. Otherwise jump back to inventory. + if (!cursorOnStash) { BeltReturnsToStash = false; Slot = -1; ActiveStashSlot = FindClosestStashSlot(MousePosition);