From 3856d1b0a745aede9f6e1ce409d31ee66cc3bdf3 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 30 Aug 2022 11:00:47 -0400 Subject: [PATCH 1/2] Fixed small key case that was behind an else and shouldn't have been --- soh/src/code/z_parameter.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 265c69ace..f8df81f34 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1711,14 +1711,12 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { return ITEM_NONE; } } + if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) { + gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1; + return ITEM_NONE; } else { - if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) { - gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1; - return ITEM_NONE; - } else { - gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]++; - return ITEM_NONE; - } + gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]++; + return ITEM_NONE; } } else if ((item == ITEM_QUIVER_30) || (item == ITEM_BOW)) { if (CUR_UPG_VALUE(UPG_QUIVER) == 0) { From 60257b98a4ae4e392ef2c049255b367a6ef34ee8 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Tue, 30 Aug 2022 11:21:29 -0400 Subject: [PATCH 2/2] Oops. Missed closing bracket. --- soh/src/code/z_parameter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index f8df81f34..8d26f3658 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1711,6 +1711,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { return ITEM_NONE; } } + } if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] < 0) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] = 1; return ITEM_NONE;