From 6e2ea181545329c3a283ecdbea495ddd2801ffcd Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Tue, 27 Feb 2024 22:48:22 +0000 Subject: [PATCH] Add proper bug comment for gSaveContext.save.dayTime getting cleared as s32 when it is u16 (#1900) * Add proper bug comment for gSaveContext.save.dayTime getting cleared as s32 when it is u16 * Formatting? --- src/code/z_sram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 253ff4b304..b5da4691c9 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -611,7 +611,9 @@ void Sram_VerifyAndLoadAllSaves(FileSelectState* fileSelect, SramContext* sramCt bzero(&gSaveContext.save.entranceIndex, sizeof(s32)); bzero(&gSaveContext.save.linkAge, sizeof(s32)); bzero(&gSaveContext.save.cutsceneIndex, sizeof(s32)); - // note that gSaveContext.save.dayTime is not actually the sizeof(s32) + //! @bug gSaveContext.save.dayTime is a u16 but is cleared as a 32-bit value. This is harmless as-is + //! since it is followed by nightFlag which is also reset here, but can become an issue if the save + //! layout is changed. bzero(&gSaveContext.save.dayTime, sizeof(s32)); bzero(&gSaveContext.save.nightFlag, sizeof(s32)); bzero(&gSaveContext.save.totalDays, sizeof(s32));