forked from teamnwah/openmw-tes3coop
Issue #370: replaced custom target handling in apply action with base class implementation
This commit is contained in:
parent
733654d730
commit
cc55056adf
2 changed files with 5 additions and 7 deletions
|
@ -6,23 +6,23 @@
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
ActionApply::ActionApply (const Ptr& target, const std::string& id)
|
ActionApply::ActionApply (const Ptr& target, const std::string& id)
|
||||||
: mTarget (target), mId (id)
|
: Action (false, target), mId (id)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void ActionApply::executeImp (const Ptr& actor)
|
void ActionApply::executeImp (const Ptr& actor)
|
||||||
{
|
{
|
||||||
MWWorld::Class::get (mTarget).apply (mTarget, mId, actor);
|
MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
|
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
|
||||||
int skillIndex, int usageType)
|
int skillIndex, int usageType)
|
||||||
: mTarget (target), mId (id), mSkillIndex (skillIndex), mUsageType (usageType)
|
: Action (false, target), mId (id), mSkillIndex (skillIndex), mUsageType (usageType)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void ActionApplyWithSkill::executeImp (const Ptr& actor)
|
void ActionApplyWithSkill::executeImp (const Ptr& actor)
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get (mTarget).apply (mTarget, mId, actor) && mUsageType!=-1)
|
if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1)
|
||||||
MWWorld::Class::get (mTarget).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
|
MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
class ActionApply : public Action
|
class ActionApply : public Action
|
||||||
{
|
{
|
||||||
Ptr mTarget;
|
|
||||||
std::string mId;
|
std::string mId;
|
||||||
|
|
||||||
virtual void executeImp (const Ptr& actor);
|
virtual void executeImp (const Ptr& actor);
|
||||||
|
@ -23,7 +22,6 @@ namespace MWWorld
|
||||||
|
|
||||||
class ActionApplyWithSkill : public Action
|
class ActionApplyWithSkill : public Action
|
||||||
{
|
{
|
||||||
Ptr mTarget;
|
|
||||||
std::string mId;
|
std::string mId;
|
||||||
int mSkillIndex;
|
int mSkillIndex;
|
||||||
int mUsageType;
|
int mUsageType;
|
||||||
|
|
Loading…
Reference in a new issue