|
|
@ -653,6 +653,9 @@ namespace MWGui
|
|
|
|
if (object.getClass().getName(object) == "") // objects without name presented to user can never be picked up
|
|
|
|
if (object.getClass().getName(object) == "") // objects without name presented to user can never be picked up
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!object.getRefData().activate())
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
int count = object.getRefData().getCount();
|
|
|
|
int count = object.getRefData().getCount();
|
|
|
|
|
|
|
|
|
|
|
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
|
|
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
|
|
@ -663,12 +666,6 @@ namespace MWGui
|
|
|
|
// 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);
|
|
|
|
|
|
|
|
|
|
|
|
if (object.getRefData().hasSuppressActivate()) // if Flag_SuppressActivate is set, script that contains OnActivate is attached to the item
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
newObject.getRefData().onActivate(); // set the flag_SuppressActivate flag for the new item
|
|
|
|
|
|
|
|
newObject.getRefData().activate();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// remove from world
|
|
|
|
// remove from world
|
|
|
|
MWBase::Environment::get().getWorld()->deleteObject (object);
|
|
|
|
MWBase::Environment::get().getWorld()->deleteObject (object);
|
|
|
|