Skip to content

Commit

Permalink
Fix night skybox glitch when beating dungeons (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
HylianFreddy authored Apr 23, 2024
1 parent f53c333 commit cea6e61
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion code/include/z3D/z3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ typedef struct {
/* 0x1594 */ char unk_1594[0x000C];
/* 0x15A0 */ u16 nextCutsceneIndex;
/* 0x15A2 */ u8 cutsceneTrigger;
/* 0x15A3 */ char unk_15A3[0x008];
/* 0x15A3 */ u8 chamberCutsceneNum;
/* 0x15A4 */ u16 nextDayTime; // "next_zelda_time"
/* 0x15A6 */ u8 transFadeDuration;
/* 0x15A7 */ u8 transWipeSpeed;
/* 0x15A8 */ u16 skyboxTime;
/* 0x15AA */ u8 dogIsLost;
/* 0x15AB */ u8 nextTransition;
/* 0x15AC */ char unk_15AC[0x006];
/* 0x15B2 */ s16 healthAccumulator;
Expand Down
16 changes: 8 additions & 8 deletions code/src/cutscenes.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void Cutscene_OverrideDekuTree(void) {
}

// Skipped if wrong warping
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}
gGlobalContext->nextEntranceIndex = Entrance_OverrideNextIndex(0x457);
gGlobalContext->sceneLoadFlag = 0x14;
Expand All @@ -226,7 +226,7 @@ void Cutscene_OverrideDodongosCavern(void) {
}

// Skipped if wrong warping
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}
gGlobalContext->nextEntranceIndex = Entrance_OverrideNextIndex(0x47A);
gGlobalContext->sceneLoadFlag = 0x14;
Expand All @@ -247,7 +247,7 @@ void Cutscene_OverrideJabuJabusBelly(void) {
}

// Skipped if wrong warping
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}
gGlobalContext->nextEntranceIndex = Entrance_OverrideNextIndex(0x10E);
gGlobalContext->sceneLoadFlag = 0x14;
Expand All @@ -259,7 +259,7 @@ void Cutscene_OverrideForestTemple(void) {
if (EventCheck(0x48) == 0) {
EventSet(0x48);
ItemOverride_PushDungeonReward(DUNGEON_FOREST_TEMPLE);
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}

s16 tempEntr = Entrance_OverrideNextIndex(0x608);
Expand All @@ -286,7 +286,7 @@ void Cutscene_OverrideFireTemple(void) {
}

// Skipped if wrong warping
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}

s16 tempEntr = Entrance_OverrideNextIndex(0x564);
Expand All @@ -305,7 +305,7 @@ void Cutscene_OverrideWaterTemple(void) {
EventSet(0x4A);
ItemOverride_PushDungeonReward(DUNGEON_WATER_TEMPLE);
gSaveContext.eventChkInf[6] |= 0x0200; // Raise Lake Hylia's Water
gSaveContext.dayTime = 0x4800;
gSaveContext.nextDayTime = 0x4000;
}

s16 tempEntr = Entrance_OverrideNextIndex(0x60C);
Expand All @@ -323,7 +323,7 @@ void Cutscene_OverrideSpiritTemple(void) {
if (EventCheck(0x47) == 0) {
EventSet(0x47);
ItemOverride_PushDungeonReward(DUNGEON_SPIRIT_TEMPLE);
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}

s16 tempEntr = Entrance_OverrideNextIndex(0x610);
Expand All @@ -341,7 +341,7 @@ void Cutscene_OverrideShadowTemple(void) {
if (EventCheck(0x46) == 0) {
EventSet(0x46);
ItemOverride_PushDungeonReward(DUNGEON_SHADOW_TEMPLE);
gSaveContext.dayTime = 0x8000;
gSaveContext.nextDayTime = 0x8000;
}

s16 tempEntr = Entrance_OverrideNextIndex(0x580);
Expand Down

0 comments on commit cea6e61

Please sign in to comment.