1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 17:19:56 +00:00
openmw-tes3mp/apps/openmw/mwworld/actiontake.cpp

25 lines
600 B
C++
Raw Normal View History

2010-08-07 18:25:17 +00:00
#include "actiontake.hpp"
#include "../mwbase/environment.hpp"
2010-08-07 18:25:17 +00:00
#include "class.hpp"
#include "world.hpp"
#include "containerstore.hpp"
2010-08-07 18:25:17 +00:00
namespace MWWorld
{
ActionTake::ActionTake (const MWWorld::Ptr& object) : mObject (object) {}
void ActionTake::execute()
2010-08-07 18:25:17 +00:00
{
// insert into player's inventory
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
2010-08-07 18:25:17 +00:00
MWWorld::Class::get (player).getContainerStore (player).add (mObject);
2010-08-07 18:25:17 +00:00
// remove from world
MWBase::Environment::get().getWorld()->deleteObject (mObject);
2010-08-07 18:25:17 +00:00
}
}