mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
24 lines
735 B
C++
24 lines
735 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(), getTarget().getRefData().getCount());
|
|
actor.getClass().getContainerStore (actor).add (getTarget(), getTarget().getRefData().getCount(), actor);
|
|
MWBase::Environment::get().getWorld()->deleteObject (getTarget());
|
|
}
|
|
}
|