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
2010-08-07 20:25:17 +02:00

23 lines
605 B
C++

#include "actiontake.hpp"
#include "class.hpp"
#include "environment.hpp"
#include "world.hpp"
namespace MWWorld
{
ActionTake::ActionTake (const MWWorld::Ptr& object) : mObject (object) {}
void ActionTake::execute (Environment& environment)
{
// insert into player's inventory
MWWorld::Ptr player = environment.mWorld->getPtr ("player", true);
MWWorld::Class::get (mObject).insertIntoContainer (mObject,
MWWorld::Class::get (player).getContainerStore (player));
// remove from world
environment.mWorld->deleteObject (mObject);
}
}