Further fixes for setting pokemon held items from angelscript.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -77,6 +77,9 @@ CScriptArray* GetMoves(const PkmnLib::Battling::Pokemon* obj) {
|
||||
static bool HasHeldItem(const PkmnLib::Battling::Pokemon* obj, const ArbUt::StringView& str) {
|
||||
return obj->HasHeldItem(str.GetHash());
|
||||
}
|
||||
static void SetHeldItemWrapper(PkmnLib::Battling::Pokemon* obj, const ArbUt::StringView& str) {
|
||||
return obj->SetHeldItem(str);
|
||||
}
|
||||
|
||||
static std::string NicknameWrapper(const PkmnLib::Battling::Pokemon* obj) { return std::string(obj->GetNickname()); }
|
||||
|
||||
@@ -126,7 +129,7 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
|
||||
Ensure(r >= 0);
|
||||
r = engine->RegisterObjectMethod(
|
||||
"Pokemon", "void SetHeldItem(const constString &in name)",
|
||||
asMETHODPR(PkmnLib::Battling::Pokemon, SetHeldItem, (const ArbUt::BasicStringView&), void), asCALL_THISCALL);
|
||||
asFUNCTION(SetHeldItemWrapper), asCALL_CDECL_OBJFIRST);
|
||||
Ensure(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Pokemon", "void SetHeldItem(const Item@ item)",
|
||||
asMETHODPR(PkmnLib::Battling::Pokemon, SetHeldItem,
|
||||
|
||||
Reference in New Issue
Block a user