From 658918e5e66e74497d36a2eba4bd2205c381a7f8 Mon Sep 17 00:00:00 2001 From: obligaron Date: Wed, 13 Dec 2023 21:30:30 +0100 Subject: [PATCH] Support unsetting spell hotkey --- Source/panels/spell_list.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/panels/spell_list.cpp b/Source/panels/spell_list.cpp index f28077349..e0dfe9a23 100644 --- a/Source/panels/spell_list.cpp +++ b/Source/panels/spell_list.cpp @@ -274,6 +274,13 @@ void SetSpeedSpell(size_t slot) return; } Player &myPlayer = *MyPlayer; + + if (myPlayer._pSplHotKey[slot] == pSpell && myPlayer._pSplTHotKey[slot] == pSplType) { + // Unset spell hotkey + myPlayer._pSplHotKey[slot] = SpellID::Invalid; + return; + } + for (size_t i = 0; i < NumHotkeys; ++i) { if (myPlayer._pSplHotKey[i] == pSpell && myPlayer._pSplTHotKey[i] == pSplType) myPlayer._pSplHotKey[i] = SpellID::Invalid;