From 4816fe02c243e6192fbd12350c8c5977bedd3b31 Mon Sep 17 00:00:00 2001 From: FosterProgramming Date: Sun, 19 Oct 2025 16:39:07 +0200 Subject: [PATCH] Bugfix hidefollower not waiting properly (#7768) --- asm/macros/event.inc | 2 +- data/script_cmd_table.inc | 1 + src/scrcmd.c | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 43b9417860..f8578a4a9c 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -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 diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index e05260d3d4..a3defef83e 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -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:: diff --git a/src/scrcmd.c b/src/scrcmd.c index 767f41c6d5..54edd76c61 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -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;