diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 546f645a1..07c12f292 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -1860,6 +1860,16 @@ namespace Settings { StartingAge.Unlock(); } + //Adult is also not compatible with the following combination: + //DoT:Intended, ShuffleOcarinas:false, Logic:Glitchless + if (OpenDoorOfTime.Is(OPENDOOROFTIME_INTENDED) && !ShuffleOcarinas && + Logic.Is(LOGIC_GLITCHLESS)) { + StartingAge.SetSelectedIndex(AGE_CHILD); + StartingAge.Lock(); + } else { + StartingAge.Unlock(); + } + //Only show stone count option if Stones is selected if (Bridge.Is(RAINBOWBRIDGE_STONES)) { BridgeStoneCount.Unhide(); @@ -2741,9 +2751,11 @@ namespace Settings { int choice = Random(0, 2); //50% chance of each if (choice == 0) { ResolvedStartingAge = AGE_CHILD; + StartingAge.SetSelectedIndex(AGE_CHILD); } else { ResolvedStartingAge = AGE_ADULT; + StartingAge.SetSelectedIndex(AGE_ADULT); } } else { diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 9f0092c9e..849f085b2 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3731,9 +3731,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", 0); cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", 0); cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0); - //Starting Age is forced to child if forest setting is set to closed. (0 = Child, 1 = Adult) - cvarSettings[RSK_STARTING_AGE] = ((CVar_GetS32("gRandomizeForest", 0)) && - (CVar_GetS32("gRandomizeStartingAge", 0))); + cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0); cvarSettings[RSK_GERUDO_FORTRESS] = CVar_GetS32("gRandomizeGerudoFortress", 0); cvarSettings[RSK_RAINBOW_BRIDGE] = CVar_GetS32("gRandomizeRainbowBridge", 0); cvarSettings[RSK_RAINBOW_BRIDGE_STONE_COUNT] = CVar_GetS32("gRandomizeStoneCount", 3); @@ -4043,14 +4041,19 @@ void DrawRandoEditor(bool& open) { ImGui::PushItemWidth(-FLT_MIN); //Starting Age - //Disabled when Forest is set to Closed - bool disableRandoStartingAge = !CVar_GetS32("gRandomizeForest", 0); - const char* disableRandoStartingAgeText = "This option is disabled because \"Forest\" is set to \"Closed\"."; + //Disabled when Forest is set to Closed or under very specific conditions + //RANDOTODO: Replace magic number checks with enums + bool disableRandoStartingAge = (CVar_GetS32("gRandomizeLogicRules", 0) == 0) && // glitchless logic + ((CVar_GetS32("gRandomizeForest", 0) == 0) || // Closed Forest + ((CVar_GetS32("gRandomizeDoorOfTime", 0) == 0) && // Closed Door of Time + (CVar_GetS32("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled + + const char* disableRandoStartingAgeText = "This option is disabled due to other options making the game unbeatable."; ImGui::Text(Settings::StartingAge.GetName().c_str()); UIWidgets::InsertHelpHoverText( "Choose which age Link will start as.\n\n" "Starting as adult means you start with the Master Sword in your inventory.\n" - "Only the child option is compatible with Closed Forest." + "The child option is forcefully set if it would conflict with other options." ); if (disableRandoStartingAge) { ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 1c3cb5b23..8c01225e0 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -376,9 +376,11 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.entranceIndex = 0x5F4; gSaveContext.savedSceneNum = SCENE_SPOT20; //Set scene num manually to ToT break; - default: //Child + case 0: //Child gSaveContext.linkAge = 1; break; + default: + break; } int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME);