diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp index 8f7065e..206af98 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp @@ -81,7 +81,8 @@ static CScriptHandle AddVolatileWrapper(PkmnLib::Battling::Pokemon* obj, const A 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()); } @@ -194,10 +195,8 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) { asMETHOD(PkmnLib::Battling::Pokemon, SetStatus), asCALL_THISCALL); Ensure(r >= 0); - - - - r = engine->RegisterObjectMethod("TypeLibrary", "float GetEffectiveness(uint8 attackingType, Pokemon@ defender)", + r = engine->RegisterObjectMethod("TypeLibrary", + "float GetEffectiveness(uint8 attackingType, Pokemon@ defender) const", asFUNCTION(GetEffectivenessHelper), asCALL_CDECL_OBJFIRST); Ensure(r >= 0); } \ No newline at end of file