From de7ecddbb8868ce8d7c14863e47f95d154fb5b7c Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sat, 11 Apr 2020 14:42:04 +0300 Subject: [PATCH] Don't play equip sound for reactivated quick key items (bug #5367) --- CHANGELOG.md | 1 + apps/openmw/mwgui/quickkeysmenu.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a5271db..1f5865996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ 0.47.0 ------ + Bug #5367: Selecting a spell on an enchanted item per hotkey always plays the equip sound 0.46.0 ------ diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index ed5328d36..39278f0fa 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -401,7 +401,8 @@ namespace MWGui return; } - MWBase::Environment::get().getWindowManager()->useItem(item); + if (!store.isEquipped(item)) + MWBase::Environment::get().getWindowManager()->useItem(item); MWWorld::ConstContainerStoreIterator rightHand = store.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); // change draw state only if the item is in player's right hand if (rightHand != store.end() && item == *rightHand) @@ -411,8 +412,8 @@ namespace MWGui } else if (key->type == Type_MagicItem) { - // equip, if it can be equipped - if (!item.getClass().getEquipmentSlots(item).first.empty()) + // equip, if it can be equipped and isn't yet equipped + if (!item.getClass().getEquipmentSlots(item).first.empty() && !store.isEquipped(item)) { MWBase::Environment::get().getWindowManager()->useItem(item);