fix: Dig in Sealed Chamber no longer freezes follower. Fixed #5482 rhh

This commit is contained in:
Ariel A 2024-10-11 13:45:40 -04:00
parent ef462d9d9b
commit d80190fe10
4 changed files with 24 additions and 3 deletions

View file

@ -376,6 +376,24 @@ EventScript_EndSurface::
releaseall
end
EventScript_DigCommon:
callfunc ScrFunc_IsFollowerFieldMoveUser
.2byte VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if true
dofieldeffect FLDEFF_USE_DIG
waitstate
EventScript_DigSealedChamber:: @ fallthrough
setflag FLAG_SAFE_FOLLOWER_MOVEMENT
call_if_eq VAR_0x8004, TRUE, EventScript_FollowerFieldMove
callnative DoBrailleDigEffect
releaseall
end
@ Use Dig from party menu
EventScript_UseDig::
lockall
goto EventScript_DigCommon
Text_CantDive:
.string "The sea is deep here. A POKéMON\n"
.string "may be able to go underwater.$"

View file

@ -404,6 +404,7 @@ extern const u8 EventScript_FailSweetScent[];
extern const u8 EventScript_UseFlash[];
extern const u8 EventScript_UseCut[];
extern const u8 EventScript_UseRockSmash[];
extern const u8 EventScript_UseDig[];
//player pc
extern const u8 LittlerootTown_BrendansHouse_2F_EventScript_TurnOffPlayerPC[];

View file

@ -87,7 +87,6 @@ void DoBrailleDigEffect(void)
DrawWholeMapView();
PlaySE(SE_BANG);
FlagSet(FLAG_SYS_BRAILLE_DIG);
UnlockPlayerFieldControls();
}
bool8 CheckRelicanthWailord(void)

View file

@ -1,11 +1,13 @@
#include "global.h"
#include "braille_puzzles.h"
#include "event_scripts.h"
#include "field_effect.h"
#include "field_player_avatar.h"
#include "fldeff.h"
#include "item_use.h"
#include "overworld.h"
#include "party_menu.h"
#include "script.h"
#include "sprite.h"
#include "constants/field_effects.h"
@ -31,8 +33,8 @@ bool8 SetUpFieldMove_Dig(void)
static void FieldCallback_Dig(void)
{
Overworld_ResetStateAfterDigEscRope();
FieldEffectStart(FLDEFF_USE_DIG);
gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext_SetupScript(EventScript_UseDig);
}
bool8 FldEff_UseDig(void)
@ -53,7 +55,8 @@ static void StartDigFieldEffect(void)
FieldEffectActiveListRemove(FLDEFF_USE_DIG);
if (ShouldDoBrailleDigEffect())
{
DoBrailleDigEffect();
// EventScript_DigSealedChamber handles DoBrailleDigEffect call
ScriptContext_Enable();
}
else
{