summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorAdam Bird <Archez@users.noreply.github.com>2022-12-06 18:37:50 -0500
committerGitHub <noreply@github.com>2022-12-07 00:37:50 +0100
commitd9f3844b2db80f74fc233391164981cf0b59f1f7 (patch)
treefad806e8287242c230434db997a11203db2d6040 /soh/src/code
parent598cac725e580b8acdf18f91263efa4d484231c9 (diff)
[Feature] Entrance Rando v2 (#2071)
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_sram.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c
index 1b3c0ff18..db6b3299a 100644
--- a/soh/src/code/z_sram.c
+++ b/soh/src/code/z_sram.c
@@ -200,14 +200,6 @@ void Sram_OpenSave() {
// Setup the modified entrance table and entrance shuffle table for rando
if (gSaveContext.n64ddFlag) {
Entrance_Init();
- if (!CVar_GetS32("gRememberSaveLocation", 0) || gSaveContext.savedSceneNum == SCENE_YOUSEI_IZUMI_TATE ||
- gSaveContext.savedSceneNum == SCENE_KAKUSIANA) {
- Entrance_SetSavewarpEntrance();
- }
- } else {
- // When going from a rando save to a vanilla save within the same game instance
- // we need to reset the entrance table back to its vanilla state
- Entrance_ResetEntranceTable();
}
osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex);
@@ -390,11 +382,18 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
break;
case RO_AGE_CHILD: //Child
gSaveContext.linkAge = 1;
+ gSaveContext.savedSceneNum = -1;
break;
default:
break;
}
+ if (Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_SPAWNS)) {
+ // Override the spawn entrance so entrance rando can take control,
+ // and to prevent remember save location from breaking inital spawn
+ gSaveContext.entranceIndex = -1;
+ }
+
int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME);
switch (doorOfTime) {
case RO_DOOROFTIME_OPEN:
@@ -580,4 +579,8 @@ void Sram_InitSram(GameState* gameState) {
Save_Init();
func_800F6700(gSaveContext.audioSetting);
+
+ // When going from a rando save to a vanilla save within the same game instance
+ // we need to reset the entrance table back to its vanilla state
+ Entrance_ResetEntranceTable();
}