Fix no punishment for stealing when taking an item with the inventory opened

openmw-36
scrawl 10 years ago
parent eef8f71797
commit 3b8b217888

@ -594,6 +594,8 @@ namespace MWGui
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWBase::Environment::get().getWorld()->breakInvisibility(player); MWBase::Environment::get().getWorld()->breakInvisibility(player);
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count);
// add to player inventory // add to player inventory
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object // 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); 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"); throw std::runtime_error("Added item not found");
mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count); mDragAndDrop->startDrag(i, mSortModel, mTradeModel, mItemView, count);
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, newObject, MWWorld::Ptr(), count);
MWBase::Environment::get().getWindowManager()->updateSpellWindow(); MWBase::Environment::get().getWindowManager()->updateSpellWindow();
} }

Loading…
Cancel
Save