diff --git a/include/z64save.h b/include/z64save.h index f3f8eb9c82..a4448fe584 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -699,8 +699,11 @@ typedef enum LinkAge { #define ITEMGETINF_1B 0x1B #define ITEMGETINF_1C 0x1C #define ITEMGETINF_1D 0x1D -#define ITEMGETINF_1E 0x1E -#define ITEMGETINF_1F 0x1F +#define ITEMGETINF_FOREST_STAGE_STICK_UPGRADE 0x1E +// This flag is shared by two events; It is set when obtaining the Deku Nut upgrade at the Forest Stage and when obtaining Poachers Saw. +// This will make obtaining the Deku Nut upgrade impossible if Poachers Saw is obtained first. +// This flag is never read for the Poachers Saw event, so the overlap only causes an issue for the Deku Nut Upgrade. It will not prevent obtaining Poachers Saw. +#define ITEMGETINF_FOREST_STAGE_NUT_UPGRADE 0x1F #define ITEMGETINF_23 0x23 #define ITEMGETINF_24 0x24 #define ITEMGETINF_25 0x25 diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index e6e451ee33..7666b1ff07 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1828,7 +1828,8 @@ u8 Item_Give(PlayState* play, u8 item) { } } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { if (item == ITEM_POACHERS_SAW) { - SET_ITEMGETINF(ITEMGETINF_1F); + //! @bug Setting this shared flag makes getting the Deku Nut upgrade impossible + SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE); } temp = INV_CONTENT(item); diff --git a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 226a9e8d47..ad1eb7e58f 100644 --- a/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -156,7 +156,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { delay = 0; switch (Player_GetMask(play)) { case PLAYER_MASK_SKULL: - if (!GET_ITEMGETINF(ITEMGETINF_1E)) { + if (!GET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_STICK_UPGRADE)) { reaction = DNT_SIGNAL_CELEBRATE; this->prize = DNT_PRIZE_STICK; SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_SARIA_THEME); @@ -164,7 +164,8 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { } FALLTHROUGH; case PLAYER_MASK_TRUTH: - if (!GET_ITEMGETINF(ITEMGETINF_1F) && (Player_GetMask(play) != PLAYER_MASK_SKULL)) { + if (!GET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE) && + (Player_GetMask(play) != PLAYER_MASK_SKULL)) { Audio_PlaySfxGeneral(NA_SE_SY_TRE_BOX_APPEAR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->prize = DNT_PRIZE_NUTS; diff --git a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index fb0b7bc340..8cb86c8d60 100644 --- a/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -282,7 +282,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { PRINTF("実 \n"); PRINTF("実 \n"); PRINTF("実 \n"); - SET_ITEMGETINF(ITEMGETINF_1F); + SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_NUT_UPGRADE); } else { // "stick" PRINTF("棒 \n"); @@ -291,7 +291,7 @@ void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { PRINTF("棒 \n"); PRINTF("棒 \n"); PRINTF("棒 \n"); - SET_ITEMGETINF(ITEMGETINF_1E); + SET_ITEMGETINF(ITEMGETINF_FOREST_STAGE_STICK_UPGRADE); } this->actor.textId = 0; if ((this->stage != NULL) && (this->stage->actor.update != NULL)) {