Mark user in ExecutingAttack as smart pointer
This commit is contained in:
parent
2d3a2fc63b
commit
6225ed19fa
|
@ -1,11 +1,14 @@
|
|||
#include "RegisterExecutingAttack.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <CreatureLib/Battling/Models/ExecutingAttack.hpp>
|
||||
#include "../HelperFile.hpp"
|
||||
|
||||
void RegisterExecutingAttack::Register(asIScriptEngine* engine) {
|
||||
RegisterHitData(engine);
|
||||
RegisterExecutingAttackType(engine);
|
||||
}
|
||||
SMART_PTR_GETTER_FUNC(CreatureLib::Battling::ExecutingAttack, CreatureLib::Battling::Creature, GetUser);
|
||||
|
||||
void RegisterExecutingAttack::RegisterHitData(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("HitData", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
Assert(r >= 0);
|
||||
|
@ -40,8 +43,8 @@ void RegisterExecutingAttack::RegisterExecutingAttackType(asIScriptEngine* engin
|
|||
asMETHOD(CreatureLib::Battling::ExecutingAttack, IsCreatureTarget),
|
||||
asCALL_THISCALL);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("ExecutingMove", "Pokemon@ get_User() const property",
|
||||
asMETHOD(CreatureLib::Battling::ExecutingAttack, GetUser), asCALL_THISCALL);
|
||||
r = engine->RegisterObjectMethod("ExecutingMove", "Pokemon@ get_User() const property", asFUNCTION(GetUserWrapper),
|
||||
asCALL_CDECL_OBJFIRST);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("ExecutingMove", "LearnedMove@ get_Move() const property",
|
||||
asMETHOD(CreatureLib::Battling::ExecutingAttack, GetAttack), asCALL_THISCALL);
|
||||
|
|
Loading…
Reference in New Issue