diff options
| author | Archez <Archez@users.noreply.github.com> | 2024-11-22 18:23:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-22 16:23:15 -0700 |
| commit | 8926d8f78451fe84c5cc50b38e015b279579511a (patch) | |
| tree | e8545c7e0a06c2e10e0a4f1dc20ba1263c835962 | |
| parent | 5520c185bf0a3db421bd92e60b95266648c8318c (diff) | |
Fix array out of bounds in entrance init (#4566)
| -rw-r--r-- | soh/soh/Enhancements/randomizer/randomizer_entrance.c | 4 | ||||
| -rw-r--r-- | soh/soh/Enhancements/randomizer/randomizer_grotto.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/soh/soh/Enhancements/randomizer/randomizer_entrance.c b/soh/soh/Enhancements/randomizer/randomizer_entrance.c index aa839cc3e..8f4a1668c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_entrance.c +++ b/soh/soh/Enhancements/randomizer/randomizer_entrance.c @@ -161,7 +161,7 @@ void Entrance_Init(void) { } // Initialize all boss room save/death warps with their vanilla dungeon entryway - for (s16 i = 1; i < SHUFFLEABLE_BOSS_COUNT; i++) { + for (s16 i = 0; i < SHUFFLEABLE_BOSS_COUNT; i++) { bossSceneSaveDeathWarps[i] = dungeons[i].entryway; } @@ -185,7 +185,7 @@ void Entrance_Init(void) { // Search for boss room overrides and look for the matching save/death warp value to use // If the boss room is in a dungeon, use the dungeons entryway as the save warp // Otherwise use the "exit" value for the entrance that lead to the boss room - for (int j = 0; j <= SHUFFLEABLE_BOSS_COUNT; j++) { + for (int j = 0; j < SHUFFLEABLE_BOSS_COUNT; j++) { if (overrideIndex == dungeons[j].bossDoor) { bossScene = dungeons[j].bossScene; } diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index 180f4ca84..f9471a2ba 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -273,7 +273,7 @@ void Grotto_OverrideActorEntrance(Actor* thisx) { void Grotto_ForceGrottoReturnOnSpecialEntrance(void) { if (lastEntranceType == GROTTO_RETURN && (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS))) { gSaveContext.respawnFlag = 2; - gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x4FF; + gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x04FF; gSaveContext.respawn[RESPAWN_MODE_RETURN].pos = grottoReturnTable[grottoId].pos; // Clear current temp flags gSaveContext.respawn[RESPAWN_MODE_RETURN].tempSwchFlags = 0; @@ -308,7 +308,7 @@ void Grotto_ForceRegularVoidOut(void) { // so that Sun's Song and Game Over will behave correctly void Grotto_SetupReturnInfoOnFWReturn(void) { if (Randomizer_GetSettingValue(RSK_SHUFFLE_GROTTO_ENTRANCES) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS) || Randomizer_GetSettingValue(RSK_SHUFFLE_WARP_SONGS) && - gSaveContext.fw.playerParams == 0x4FF) { + gSaveContext.fw.playerParams == 0x04FF) { gSaveContext.respawn[RESPAWN_MODE_RETURN] = gSaveContext.respawn[RESPAWN_MODE_TOP]; gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams = 0x0DFF; lastEntranceType = GROTTO_RETURN; |
