From f18a31b97478ff4df6b207ccaca614a7c0274b34 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Sun, 29 May 2022 16:46:59 -0400 Subject: [PATCH] Replaces TempClear flag with local variable --- soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index e3c0b124b..99bb77e96 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -10,6 +10,8 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) +bool heartPieceSpawned; + void EnTk_Init(Actor* thisx, GlobalContext* globalCtx); void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnTk_Update(Actor* thisx, GlobalContext* globalCtx); @@ -505,6 +507,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { this->currentReward = -1; this->currentSpot = NULL; this->actionFunc = EnTk_Rest; + heartPieceSpawned = false; } void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -614,13 +617,13 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) { // If vanilla itemGetInf flag is not set, it's impossible for the new flag to be set, so return true. // Otherwise if the gGravediggingTourFix is enabled and the new flag hasn't been set, return true. // If true, spawn the heart piece and set the vanilla itemGetInf flag and new temp clear flag. - if (!Flags_GetTempClear(globalCtx, TEMPCLEARFLAG_GRAVEDIGGING_HEART_PIECE) && + if (!heartPieceSpawned && (!(gSaveContext.itemGetInf[1] & ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE) || CVar_GetS32("gGravediggingTourFix", 0) && !Flags_GetCollectible(globalCtx, COLLECTFLAG_GRAVEDIGGING_HEART_PIECE))) { this->currentReward = 4; gSaveContext.itemGetInf[1] |= ITEMGETINFFLAG_GRAVEDIGGING_HEART_PIECE; - Flags_SetTempClear(globalCtx, TEMPCLEARFLAG_GRAVEDIGGING_HEART_PIECE); + heartPieceSpawned = true; } }