From b8c358df63a079b29096cdc811dc991665fd8498 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 17 Nov 2013 13:37:19 +0100 Subject: [PATCH] Fix a bug with equipping using the quick keys: when item is already equipped, equipping it again would cause the slot to get unequipped first, possibly restacking and destroying the Ptr that was supposed to be equipped in the first place --- apps/openmw/mwworld/actionequip.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwworld/actionequip.cpp b/apps/openmw/mwworld/actionequip.cpp index 2a50b8a600..0d091e7425 100644 --- a/apps/openmw/mwworld/actionequip.cpp +++ b/apps/openmw/mwworld/actionequip.cpp @@ -60,6 +60,9 @@ namespace MWWorld for (std::vector::const_iterator slot=slots_.first.begin(); slot!=slots_.first.end(); ++slot) { + // if the item is equipped already, nothing to do + if (invStore.getSlot(*slot) == it) + return; // if all slots are occupied, replace the last slot if (slot == --slots_.first.end())