From 3b8b217888469c839c53ca4945deaeb88ac4d6bf Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 8 May 2015 02:22:39 +0200 Subject: [PATCH] Fix no punishment for stealing when taking an item with the inventory opened --- apps/openmw/mwgui/inventorywindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 80b246e84..9aa8a8ea1 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -594,6 +594,8 @@ namespace MWGui MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWBase::Environment::get().getWorld()->breakInvisibility(player); + MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count); + // add to player inventory // can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player); @@ -612,8 +614,6 @@ namespace MWGui throw std::runtime_error("Added item not found"); mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count); - MWBase::Environment::get().getMechanicsManager()->itemTaken(player, newObject, MWWorld::Ptr(), count); - MWBase::Environment::get().getWindowManager()->updateSpellWindow(); }