Fixes IsUseValidForCreature Angelscript function calling wrong function.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-03-13 14:22:56 +01:00
parent 1540009912
commit 9f973c53df
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 2 deletions

View File

@ -50,12 +50,12 @@ bool AngelScriptItemUseScript::IsCreatureUseItem() const {
return res;
}
bool AngelScriptItemUseScript::IsUseValidForCreature(CreatureLib::Battling::Creature* creature) const {
if (!__IsPokemonUseItem.Exists) {
if (!__IsUseValidForPokemon.Exists) {
return CreatureLib::Battling::ItemUseScript::IsUseValidForCreature(creature);
}
bool res = false;
AngelScriptUtils::AngelscriptFunctionCall(
__IsPokemonUseItem.Function, _resolver->GetContextPool(), _scriptObject, ""_cnc,
__IsUseValidForPokemon.Function, _resolver->GetContextPool(), _scriptObject, ""_cnc,
[&]([[maybe_unused]] asIScriptContext* ctx) { ctx->SetArgObject(0, (void*)creature); },
[&]([[maybe_unused]] asIScriptContext* ctx) { res = ctx->GetReturnByte() == 1; });
return res;