forked from teamnwah/openmw-tes3coop
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
605 B
C++
24 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);
|
|
}
|
|
}
|