diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp index 1645a5e..ad2887a 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterBattleClass.cpp @@ -84,6 +84,13 @@ static CScriptHandle BattleSide_AddVolatileWrapper(CreatureLib::Battling::Battle return handle; } +static bool Battle_HasVolatileWrapper(PkmnLib::Battling::Battle* obj, const ArbUt::StringView& name) { + return obj->HasVolatileScript(name); +} +static bool BattleSide_HasVolatileWrapper(CreatureLib::Battling::BattleSide* obj, const ArbUt::StringView& name) { + return obj->HasVolatileScript(name); +} + static u8 GetPokemonIndexWrapper(CreatureLib::Battling::BattleSide* obj, PkmnLib::Battling::Pokemon* pokemon) { return obj->GetCreatureIndex(pokemon); } @@ -120,6 +127,9 @@ void RegisterBattleClass::RegisterBattleSide(asIScriptEngine* engine) { asMETHODPR(CreatureLib::Battling::BattleSide, RemoveVolatileScript, (const ArbUt::BasicStringView&), void), asCALL_THISCALL); Ensure(r >= 0); + r = engine->RegisterObjectMethod("BattleSide", "bool HasVolatile(const constString &in name) const", + asFUNCTION(BattleSide_HasVolatileWrapper), asCALL_CDECL_OBJFIRST); + Ensure(r >= 0); } void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) { @@ -169,4 +179,7 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) { r = engine->RegisterObjectMethod("Battle", "BattleParty@ FindPartyForPokemon(Pokemon@ pokemon)", asFUNCTION(FindPartyWrapper), asCALL_CDECL_OBJFIRST); Ensure(r >= 0); + r = engine->RegisterObjectMethod("Battle", "bool HasVolatile(const constString &in name) const", + asFUNCTION(Battle_HasVolatileWrapper), asCALL_CDECL_OBJFIRST); + Ensure(r >= 0); }