1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 18:15:33 +00:00
openmw-tes3mp/apps/openmw/mwworld/actionapply.cpp

29 lines
828 B
C++
Raw Normal View History

2012-07-13 07:41:38 +00:00
#include "actionapply.hpp"
#include "class.hpp"
namespace MWWorld
{
ActionApply::ActionApply (const Ptr& target, const std::string& id, const Ptr& actor)
: mTarget (target), mId (id), mActor (actor)
{}
void ActionApply::execute()
{
MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor);
}
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
const Ptr& actor, int skillIndex, int usageType)
: mTarget (target), mId (id), mActor (actor), mSkillIndex (skillIndex), mUsageType (usageType)
{}
void ActionApplyWithSkill::execute()
{
2012-07-17 14:44:55 +00:00
if (MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor) && mUsageType!=-1)
2012-07-13 07:41:38 +00:00
MWWorld::Class::get (mTarget).skillUsageSucceeded (mActor, mSkillIndex, mUsageType);
}
}