From 5d9035c6b224f7d23af731699bf3214571ed6ebf Mon Sep 17 00:00:00 2001 From: Finbar Crago Date: Sun, 1 Jul 2018 13:46:23 +1000 Subject: [PATCH] [Fixes #4482] Missing HandToHand on key quick key 0 (introduced in MR !11 for issue #4480) because apparently i can't count to ten... --- apps/openmw/mwgui/quickkeysmenu.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 4bfbd4dac..badf50213 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -124,7 +124,7 @@ namespace MWGui while (key->button->getChildCount()) // Destroy number label MyGUI::Gui::getInstance().destroyWidget(key->button->getChildAt(0)); - if (key->index == 9) + if (key->index == 10) { key->type = Type_HandToHand; @@ -163,6 +163,10 @@ namespace MWGui assert(index != -1); mSelected = &mKey[index]; + // prevent reallocation of zero key from Type_HandToHand + if(mSelected->index == 10) + return; + // open assign dialog if (!mAssignDialog) mAssignDialog = new QuickKeysMenuAssign(this); @@ -304,7 +308,7 @@ namespace MWGui void QuickKeysMenu::activateQuickKey(int index) { - assert(index >= 1 && index <= 9); + assert(index >= 1 && index <= 10); keyData *key = &mKey[index-1];