1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/apps/openmw/mwworld/actiontake.cpp

24 lines
576 B
C++
Raw Normal View History

2010-08-07 18:25:17 +00:00
#include "actiontake.hpp"
#include "class.hpp"
#include "environment.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 (Environment& environment)
{
// insert into player's inventory
MWWorld::Ptr player = environment.mWorld->getPtr ("player", true);
MWWorld::Class::get (player).getContainerStore (player).add (mObject);
2010-08-07 18:25:17 +00:00
// remove from world
environment.mWorld->deleteObject (mObject);
}
}