Fixed Angelscript ExecutingAttack::GetHitData function.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-08-04 13:08:43 +02:00
parent 4c48085840
commit 6ffcd4dcbc
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,10 @@ void RegisterExecutingAttack::Register(asIScriptEngine* engine) {
} }
BORROWED_PTR_GETTER_FUNC(CreatureLib::Battling::ExecutingAttack, CreatureLib::Battling::Creature, GetUser); BORROWED_PTR_GETTER_FUNC(CreatureLib::Battling::ExecutingAttack, CreatureLib::Battling::Creature, GetUser);
BORROWED_PTR_GETTER_FUNC(CreatureLib::Battling::ExecutingAttack, CreatureLib::Battling::LearnedAttack, GetAttack); BORROWED_PTR_GETTER_FUNC(CreatureLib::Battling::ExecutingAttack, CreatureLib::Battling::LearnedAttack, GetAttack);
static CreatureLib::Battling::ExecutingAttack::HitData*
GetHitDataWrapper(CreatureLib::Battling::ExecutingAttack* obj, CreatureLib::Battling::Creature* c, uint8_t hit) {
return &obj->GetHitData(c, hit);
}
void RegisterExecutingAttack::RegisterHitData(asIScriptEngine* engine) { void RegisterExecutingAttack::RegisterHitData(asIScriptEngine* engine) {
[[maybe_unused]] int r = engine->RegisterObjectType("HitData", 0, asOBJ_REF | asOBJ_NOCOUNT); [[maybe_unused]] int r = engine->RegisterObjectType("HitData", 0, asOBJ_REF | asOBJ_NOCOUNT);
@ -38,7 +42,7 @@ void RegisterExecutingAttack::RegisterExecutingAttackType(asIScriptEngine* engin
[[maybe_unused]] int r = engine->RegisterObjectType("ExecutingMove", 0, asOBJ_REF | asOBJ_NOCOUNT); [[maybe_unused]] int r = engine->RegisterObjectType("ExecutingMove", 0, asOBJ_REF | asOBJ_NOCOUNT);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectMethod("ExecutingMove", "HitData@ GetHitData(Pokemon@ target, uint8 hit) const", r = engine->RegisterObjectMethod("ExecutingMove", "HitData@ GetHitData(Pokemon@ target, uint8 hit) const",
asMETHOD(CreatureLib::Battling::ExecutingAttack, GetHitData), asCALL_THISCALL); asFUNCTION(GetHitDataWrapper), asCALL_CDECL_OBJFIRST);
Assert(r >= 0); Assert(r >= 0);
r = engine->RegisterObjectMethod("ExecutingMove", "bool IsPokemonTarget(Pokemon@ pkmn) const", r = engine->RegisterObjectMethod("ExecutingMove", "bool IsPokemonTarget(Pokemon@ pkmn) const",
asMETHOD(CreatureLib::Battling::ExecutingAttack, IsCreatureTarget), asMETHOD(CreatureLib::Battling::ExecutingAttack, IsCreatureTarget),