mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 23:19:56 +00:00
23 lines
802 B
C++
23 lines
802 B
C++
#include "actiontake.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
#include "../mwbase/world.hpp"
|
|
#include "../mwbase/windowmanager.hpp"
|
|
#include "../mwbase/mechanicsmanager.hpp"
|
|
|
|
#include "class.hpp"
|
|
#include "containerstore.hpp"
|
|
|
|
namespace MWWorld
|
|
{
|
|
ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (true, object) {}
|
|
|
|
void ActionTake::executeImp (const Ptr& actor)
|
|
{
|
|
MWBase::Environment::get().getMechanicsManager()->itemTaken(
|
|
actor, getTarget(), MWWorld::Ptr(), getTarget().getRefData().getCount());
|
|
MWWorld::Ptr newitem = *actor.getClass().getContainerStore (actor).add (getTarget(), getTarget().getRefData().getCount(), actor);
|
|
MWBase::Environment::get().getWorld()->deleteObject (getTarget());
|
|
setTarget(newitem);
|
|
}
|
|
}
|