From c93b6188c8baea04edbdf7f6898fc1d9a4cfab67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 17 Mar 2026 04:14:18 +0000 Subject: [PATCH] Fix swimvoid in Zora River respawning in unloaded room (#6360) Caused by spawning in Zora's River with entrance rando, going downstream to different room, then swimvoid Before the area by waterfall would not be loaded, instead downstream still loaded --- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index cc3c6c81a..f2a31de87 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2515,7 +2515,7 @@ typedef struct { } SpecialRespawnInfo; // size = 0x10 // special respawns used when voided out without swim to prevent infinite loops -std::map swimSpecialRespawnInfo = { +std::unordered_map swimSpecialRespawnInfo = { { ENTR_ZORAS_RIVER_3, // hf to zr in water { { -1455.443f, -20.0f, 1384.826f }, 28761 } }, { ENTR_HYRULE_FIELD_14, // zr to hf in water @@ -2552,12 +2552,15 @@ void RandomizerOnPlayerUpdateHandler() { GameInteractor::RawAction::TeleportPlayer( Entrance_OverrideNextIndex(ENTR_LAKE_HYLIA_OUTSIDE_TEMPLE)); // lake hylia from water temple } else { - if (swimSpecialRespawnInfo.find(gSaveContext.entranceIndex) != swimSpecialRespawnInfo.end()) { - SpecialRespawnInfo* respawnInfo = &swimSpecialRespawnInfo.at(gSaveContext.entranceIndex); - + auto respawn = swimSpecialRespawnInfo.find(gSaveContext.entranceIndex); + if (respawn != swimSpecialRespawnInfo.end()) { Play_SetupRespawnPoint(gPlayState, RESPAWN_MODE_DOWN, 0xDFF); - gSaveContext.respawn[RESPAWN_MODE_DOWN].pos = respawnInfo->pos; - gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw = respawnInfo->yaw; + if (gPlayState->sceneNum == gEntranceTable[gSaveContext.entranceIndex].scene) { + gSaveContext.respawn[RESPAWN_MODE_DOWN].roomIndex = + gPlayState->setupEntranceList[gEntranceTable[gSaveContext.entranceIndex].spawn].room; + } + gSaveContext.respawn[RESPAWN_MODE_DOWN].pos = respawn->second.pos; + gSaveContext.respawn[RESPAWN_MODE_DOWN].yaw = respawn->second.yaw; } Play_TriggerVoidOut(gPlayState);