2010-08-07 18:25:17 +00:00
|
|
|
|
|
|
|
#include "actiontake.hpp"
|
|
|
|
|
|
|
|
#include "class.hpp"
|
|
|
|
#include "environment.hpp"
|
|
|
|
#include "world.hpp"
|
2012-02-23 11:38:25 +00:00
|
|
|
#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);
|
|
|
|
|
2012-02-23 11:38:25 +00:00
|
|
|
MWWorld::Class::get (player).getContainerStore (player).add (mObject);
|
2010-08-07 18:25:17 +00:00
|
|
|
|
|
|
|
// remove from world
|
|
|
|
environment.mWorld->deleteObject (mObject);
|
|
|
|
}
|
|
|
|
}
|