From cbd0b3ef0cf134d6fa0495cd4e589257e136bea3 Mon Sep 17 00:00:00 2001 From: shachar700 <48739719+shachar700@users.noreply.github.com> Date: Sun, 5 Jan 2025 17:45:21 +0200 Subject: [PATCH] Field effect for cutting grass is missing setfieldeffectargument. Issue #5766 (#5952) --- data/scripts/field_move_scripts.inc | 12 ++++++++++++ include/event_scripts.h | 1 + src/fldeff_cut.c | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/data/scripts/field_move_scripts.inc b/data/scripts/field_move_scripts.inc index 0a7660b4ce..f1bd3618e1 100644 --- a/data/scripts/field_move_scripts.inc +++ b/data/scripts/field_move_scripts.inc @@ -385,6 +385,18 @@ EventScript_UseDig:: lockall goto EventScript_DigCommon + +EventScript_CutGrassCommon: + isfollowerfieldmoveuser VAR_0x8004 + setfieldeffectargument 3, VAR_0x8004 @ skip pose if true + dofieldeffect FLDEFF_USE_CUT_ON_GRASS + waitstate + +@ Use Cut grass from party menu +EventScript_UseCutGrass:: + lockall + goto EventScript_CutGrassCommon + Text_CantDive: .string "The sea is deep here. A POKéMON\n" .string "may be able to go underwater.$" diff --git a/include/event_scripts.h b/include/event_scripts.h index 60a8d6123e..04bcf32760 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -405,6 +405,7 @@ extern const u8 EventScript_UseFlash[]; extern const u8 EventScript_UseCut[]; extern const u8 EventScript_UseRockSmash[]; extern const u8 EventScript_UseDig[]; +extern const u8 EventScript_UseCutGrass[]; //player pc extern const u8 LittlerootTown_BrendansHouse_2F_EventScript_TurnOffPlayerPC[]; diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 2304381673..a7eccf651c 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -277,8 +277,8 @@ bool8 SetUpFieldMove_Cut(void) static void FieldCallback_CutGrass(void) { - FieldEffectStart(FLDEFF_USE_CUT_ON_GRASS); gFieldEffectArguments[0] = GetCursorSelectionMonId(); + ScriptContext_SetupScript(EventScript_UseCutGrass); } bool8 FldEff_UseCutOnGrass(void)