From a5654dd17604a6aaea386a3b3c919fb96d752ea9 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 162d4dcd4..e4ed31881 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;