mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 15:39:02 +00:00
1e4a854433
It was just adding a level of indirection to Ptr.getClass(). All the call were replaced by that instead. The number of lines changed is important, but the change itself is trivial, so everything should be fine. :)
36 lines
1013 B
C++
36 lines
1013 B
C++
|
|
#include "actionapply.hpp"
|
|
|
|
#include "class.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
#include "../mwbase/world.hpp"
|
|
|
|
namespace MWWorld
|
|
{
|
|
ActionApply::ActionApply (const Ptr& target, const std::string& id)
|
|
: Action (false, target), mId (id)
|
|
{}
|
|
|
|
void ActionApply::executeImp (const Ptr& actor)
|
|
{
|
|
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
|
|
|
getTarget().getClass().apply (getTarget(), mId, actor);
|
|
}
|
|
|
|
|
|
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
|
|
int skillIndex, int usageType)
|
|
: Action (false, target), mId (id), mSkillIndex (skillIndex), mUsageType (usageType)
|
|
{}
|
|
|
|
void ActionApplyWithSkill::executeImp (const Ptr& actor)
|
|
{
|
|
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
|
|
|
if (getTarget().getClass().apply (getTarget(), mId, actor) && mUsageType!=-1)
|
|
getTarget().getClass().skillUsageSucceeded (actor, mSkillIndex, mUsageType);
|
|
}
|
|
}
|