From 6b0f125be056b9fe3976fc49e9edf96723112bdb Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Tue, 11 Jan 2022 16:01:04 +0200 Subject: [PATCH] Match sub_0806D5D4 --- include/player.h | 6 ++++-- src/npc/bigGoron.c | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/player.h b/include/player.h index 583d882b..6ff4018b 100644 --- a/include/player.h +++ b/include/player.h @@ -247,8 +247,7 @@ typedef struct { /*0x08*/ u8 filler[2]; /*0x0a*/ u8 charm; /*0x0b*/ u8 unkB; - /*0x0c*/ u8 itemOnA; - /*0x0d*/ u8 itemOnB; + /*0x0c*/ u8 itemButtons[2]; /*0x0e*/ u8 bottles[4]; /*0x12*/ u8 effect; /*0x13*/ u8 filler3[5]; @@ -260,6 +259,9 @@ typedef struct { /*0x22*/ u8 filler4[4]; } Stats; +#define itemOnA itemButtons[0] +#define itemOnB itemButtons[1] + typedef struct { /*0x0*/ u8 field_0x0; /*0x1*/ u8 behaviorID; diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index 7f45152e..7bb9f3e3 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -298,18 +298,16 @@ void sub_0806D514(Entity* this) { ASM_FUNC("asm/non_matching/bigGoron/sub_0806D520.inc", void sub_0806D520(Entity* this, u32 param)) -// TODO itemOnA and itemOnB would need to be in array? -NONMATCH("asm/non_matching/bigGoron/sub_0806D5D4.inc", void sub_0806D5D4(void)) { +void sub_0806D5D4(void) { u32 itemSlot; InitBiggoronTimer(); itemSlot = IsItemEquipped(0xd); if (itemSlot != 2) { - ((u8*)&gSave.stats.itemOnA)[itemSlot] = 0; + gSave.stats.itemButtons[itemSlot] = 0; } sub_0807CAA0(0xd, 0); } -END_NONMATCH void sub_0806D600(Entity* this, ScriptExecutionContext* context) { context->condition = gSave.timers[2] == 0;