From ab3eb845812caafff4244bb5d1bd7b2295a45708 Mon Sep 17 00:00:00 2001 From: Nicholas Calaway Date: Mon, 11 Jul 2022 17:26:29 -0400 Subject: [PATCH] Fix bad interaction between hold to attack and quick cast (#4965) --- Source/controls/plrctrls.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 0875c02ab..16fa022a4 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -2030,6 +2030,7 @@ void PerformSecondaryAction() void QuickCast(int slot) { + MouseActionType prevMouseButtonAction = LastMouseButtonAction; auto &myPlayer = Players[MyPlayerId]; spell_id spell = myPlayer._pSplHotKey[slot]; spell_type spellType = myPlayer._pSplTHotKey[slot]; @@ -2039,12 +2040,7 @@ void QuickCast(int slot) } CheckPlrSpell(false, spell, spellType); - if (pcursplr != -1) - LastMouseButtonAction = MouseActionType::SpellPlayerTarget; - else if (pcursmonst != -1) - LastMouseButtonAction = MouseActionType::SpellMonsterTarget; - else - LastMouseButtonAction = MouseActionType::Spell; + LastMouseButtonAction = prevMouseButtonAction; } } // namespace devilution