2010-08-07 18:25:17 +00:00
|
|
|
|
|
|
|
#include "actiontake.hpp"
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-07-03 10:30:50 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
2012-08-12 16:11:09 +00:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2010-08-07 18:25:17 +00:00
|
|
|
#include "class.hpp"
|
2012-02-23 11:38:25 +00:00
|
|
|
#include "containerstore.hpp"
|
2010-08-07 18:25:17 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-09-04 18:56:28 +00:00
|
|
|
ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (true, object) {}
|
2010-08-07 18:25:17 +00:00
|
|
|
|
2013-02-17 14:56:22 +00:00
|
|
|
void ActionTake::executeImp (const Ptr& actor)
|
2010-08-07 18:25:17 +00:00
|
|
|
{
|
|
|
|
// insert into player's inventory
|
2012-04-23 13:27:03 +00:00
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
|
2010-08-07 18:25:17 +00:00
|
|
|
|
2013-08-07 12:45:23 +00:00
|
|
|
MWWorld::Class::get (player).getContainerStore (player).add (getTarget(), player);
|
2010-08-07 18:25:17 +00:00
|
|
|
|
2012-09-04 13:34:44 +00:00
|
|
|
MWBase::Environment::get().getWorld()->deleteObject (getTarget());
|
2010-08-07 18:25:17 +00:00
|
|
|
}
|
|
|
|
}
|