From 64965ee92602dbce3f785bc011c52f4b56edf9fc Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 15 Aug 2022 22:22:47 -0500 Subject: [PATCH] Use GiveItemEntryFromActorWithFixedRange in item00 --- soh/src/code/z_en_item00.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 5245e45c0..6713a537d 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -512,8 +512,11 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) { getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); getItemId = getItem.getItemId; - func_8002F554(&this->actor, globalCtx, getItemId); - GET_PLAYER(globalCtx)->getItemEntry = getItem; + if (!gSaveContext.n64ddFlag) { + func_8002F554(&this->actor, globalCtx, getItemId); + } else { + GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem); + } } EnItem00_SetupAction(this, func_8001E5C8); @@ -884,12 +887,13 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { params = &this->actor.params; if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) { - if (gSaveContext.n64ddFlag) { + if (!gSaveContext.n64ddFlag) { + func_8002F554(&this->actor, globalCtx, getItemId); + } else { getItem = Randomizer_GetRandomizedItem(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); - GET_PLAYER(globalCtx)->getItemEntry = getItem; getItemId = getItem.getItemId; + GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem); } - func_8002F554(&this->actor, globalCtx, getItemId); } switch (*params) {