Adds const marker to new GetEffectiveness helper in Angelscript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-20 10:59:18 +01:00
parent d94d1287ef
commit 8de1d4d635
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 4 additions and 5 deletions

View File

@ -81,7 +81,8 @@ static CScriptHandle AddVolatileWrapper(PkmnLib::Battling::Pokemon* obj, const A
return handle; return handle;
} }
static float GetEffectivenessHelper(CreatureLib::Library::TypeLibrary* typeLib, u8 attackingType, PkmnLib::Battling::Pokemon* pokemon){ static float GetEffectivenessHelper(CreatureLib::Library::TypeLibrary* typeLib, u8 attackingType,
PkmnLib::Battling::Pokemon* pokemon) {
return typeLib->GetEffectiveness(attackingType, pokemon->GetTypes()); return typeLib->GetEffectiveness(attackingType, pokemon->GetTypes());
} }
@ -194,10 +195,8 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
asMETHOD(PkmnLib::Battling::Pokemon, SetStatus), asCALL_THISCALL); asMETHOD(PkmnLib::Battling::Pokemon, SetStatus), asCALL_THISCALL);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("TypeLibrary",
"float GetEffectiveness(uint8 attackingType, Pokemon@ defender) const",
r = engine->RegisterObjectMethod("TypeLibrary", "float GetEffectiveness(uint8 attackingType, Pokemon@ defender)",
asFUNCTION(GetEffectivenessHelper), asCALL_CDECL_OBJFIRST); asFUNCTION(GetEffectivenessHelper), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0); Ensure(r >= 0);
} }