Fixes MoveData::HasFlag using OBJLAST instead of OBJFIRST, causing memory corruption.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-21 12:59:11 +01:00
parent 4d81ca1d08
commit 2396615d4a
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 2 additions and 2 deletions

View File

@ -345,7 +345,7 @@ CreatureLib::Battling::BattleScript* AngelScriptScript::Clone(const ArbUt::Optio
void AngelScriptScript::OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) {
CALL_HOOK(OnFaint, {
ctx->SetArgObject(0, (void*)creature);
ctx->SetArgDWord(1, static_cast<i32>(source));
ctx->SetArgDWord(1, (i32)source);
})
}
void AngelScriptScript::BlockWeather(CreatureLib::Battling::Battle* battle, bool* blockWeather) {

View File

@ -39,7 +39,7 @@ void RegisterMoveTypes::RegisterMoveType(asIScriptEngine* engine) {
REGISTER_GETTER("MoveData", "int8 get_Priority() const property", CreatureLib::Library::AttackData, GetPriority);
r = engine->RegisterObjectMethod("MoveData", "bool HasFlag(const constString &in flag) const", asFUNCTION(HasFlag),
asCALL_CDECL_OBJLAST);
asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
}
void RegisterMoveTypes::RegisterMoveLibrary(asIScriptEngine* engine) {