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
This commit is contained in:
Philip Dubé
2026-03-17 04:14:18 +00:00
committed by GitHub
parent e6d6b6d7d1
commit c93b6188c8

View File

@@ -2515,7 +2515,7 @@ typedef struct {
} SpecialRespawnInfo; // size = 0x10
// special respawns used when voided out without swim to prevent infinite loops
std::map<s32, SpecialRespawnInfo> swimSpecialRespawnInfo = {
std::unordered_map<s32, SpecialRespawnInfo> 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);