Bugfix hidefollower not waiting properly (#7768)
Some checks are pending
CI / build (push) Waiting to run
CI / allcontributors (push) Waiting to run
Docs / deploy (push) Waiting to run

This commit is contained in:
FosterProgramming 2025-10-19 16:39:07 +02:00 committed by GitHub
parent 5b2ecfe4d4
commit 4816fe02c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -2482,7 +2482,7 @@
@ Hides any follower Pokémon if present, putting them into their Poké Ball; by default waits for their movement to finish.
.macro hidefollower wait=1
callnative ScrFunc_hidefollower
.byte SCR_OP_HIDEFOLLOWER
.2byte \wait
.endm

View File

@ -251,6 +251,7 @@ gScriptCmdTable::
script_cmd_table_entry SCR_OP_BUFFERITEMNAMEPLURAL ScrCmd_bufferitemnameplural, requests_effects=1 @ 0xe2
script_cmd_table_entry SCR_OP_DYNMULTICHOICE ScrCmd_dynmultichoice, requests_effects=1 @ 0xe3
script_cmd_table_entry SCR_OP_DYNMULTIPUSH ScrCmd_dynmultipush, requests_effects=1 @ 0xe4
script_cmd_table_entry SCR_OP_HIDEFOLLOWER ScrCmd_hidefollower, requests_effects=1 @ 0xe5
.if ALLOCATE_SCRIPT_CMD_TABLE
gScriptCmdTableEnd::

View File

@ -3154,11 +3154,13 @@ bool8 Scrcmd_getobjectfacingdirection(struct ScriptContext *ctx)
return FALSE;
}
bool8 ScrFunc_hidefollower(struct ScriptContext *ctx)
bool8 ScrCmd_hidefollower(struct ScriptContext *ctx)
{
bool16 wait = VarGet(ScriptReadHalfword(ctx));
struct ObjectEvent *obj;
Script_RequestEffects(SCREFF_V1 | SCREFF_HARDWARE);
if ((obj = ScriptHideFollower()) != NULL && wait)
{
sMovingNpcId = obj->localId;