From 0e1248f8406da76c0bd7c6c6ed029a35c07c9d57 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Mon, 26 Sep 2022 17:24:19 -0500 Subject: [PATCH] [#1602] Fix crash when attempting to render a non-randomized item in bombchu bowling (#1604) --- soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 80cf97b32..299346370 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -511,7 +511,7 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) { if (this) {} func_8002ED80(&this->actor, globalCtx, 0); if (gSaveContext.n64ddFlag) { - GetItemEntry randoGetItem; + GetItemEntry randoGetItem = (GetItemEntry)GET_ITEM_NONE; switch (this->type) { case EXITEM_BOMB_BAG_BOWLING: case EXITEM_BOMB_BAG_COUNTER: @@ -526,9 +526,11 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) { break; } - EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItem); - GetItemEntry_Draw(globalCtx, randoGetItem); - return; + if (randoGetItem.getItemId != GI_NONE) { + EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItem); + GetItemEntry_Draw(globalCtx, randoGetItem); + return; + } } GetItem_Draw(globalCtx, this->giDrawId);