From 55f34f4f0d1e42494cd2af1b369fa41b45b1e470 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Fri, 29 Jul 2022 11:28:56 +0300 Subject: [PATCH] Delay any quick key use while the player isn't ready (bug #6054) --- CHANGELOG.md | 1 + apps/openmw/mwgui/quickkeysmenu.cpp | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 860477345f..8a96fb68a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Bug #5989: Simple water isn't affected by texture filter settings Bug #6037: Launcher: Morrowind content language cannot be set to English Bug #6051: NaN water height in ESM file is not handled gracefully + Bug #6054: Hotkey items can be equipped while in ready to attack stance Bug #6066: Addtopic "return" does not work from within script. No errors thrown Bug #6067: ESP loader fails for certain subrecord orders Bug #6087: Bound items added directly to the inventory disappear if their corresponding spell effect ends diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 5608e8b767..9aa110adcb 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -363,11 +363,11 @@ namespace MWGui bool godmode = MWBase::Environment::get().getWorld()->getGodModeState(); bool isReturnNeeded = (!godmode && playerStats.isParalyzed()) || playerStats.isDead(); - if (isReturnNeeded && key->type != Type_Item) + if (isReturnNeeded) { return; } - else if (isDelayNeeded && key->type != Type_Item) + else if (isDelayNeeded) { mActivated = key; return; @@ -407,21 +407,6 @@ namespace MWGui if (key->type == Type_Item) { - bool isWeapon = item.getType() == ESM::Weapon::sRecordId; - bool isTool = item.getType() == ESM::Probe::sRecordId || - item.getType() == ESM::Lockpick::sRecordId; - - // delay weapon switching if player is busy - if (isDelayNeeded && (isWeapon || isTool)) - { - mActivated = key; - return; - } - else if (isReturnNeeded && (isWeapon || isTool)) - { - return; - } - if (!store.isEquipped(item)) MWBase::Environment::get().getWindowManager()->useItem(item); MWWorld::ConstContainerStoreIterator rightHand = store.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);