diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index a95ff6830..f3cb98a5c 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -558,7 +558,7 @@ const std::vector s6PresetEntries = { PRESET_ENTRY_S32("gRandomizeGanonTrial", 0), PRESET_ENTRY_S32("gRandomizeGerudoFortress", RO_GF_FAST), PRESET_ENTRY_S32("gRandomizeIceTraps", 0), - PRESET_ENTRY_S32("gRandomizeKakarikoGate", 1), + PRESET_ENTRY_S32("gRandomizeKakarikoGate", RO_KAK_GATE_OPEN), PRESET_ENTRY_S32("gRandomizeMedallionCount", 6), PRESET_ENTRY_S32("gRandomizeMqDungeons", 0), PRESET_ENTRY_S32("gRandomizeRainbowBridge", 3), @@ -597,7 +597,7 @@ const std::vector hellModePresetEntries = { PRESET_ENTRY_S32("gRandomizeGsExpectSunsSong", 1), PRESET_ENTRY_S32("gRandomizeIceTraps", 4), PRESET_ENTRY_S32("gRandomizeItemPool", RO_ITEM_POOL_MINIMAL), - PRESET_ENTRY_S32("gRandomizeKakarikoGate", 1), + PRESET_ENTRY_S32("gRandomizeKakarikoGate", RO_KAK_GATE_OPEN), PRESET_ENTRY_S32("gRandomizeKeysanity", 5), PRESET_ENTRY_S32("gRandomizeLinksPocket", 3), PRESET_ENTRY_S32("gRandomizeMqDungeons", 2), diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 0e4782015..4427b0766 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -603,9 +603,9 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { break; case RSK_KAK_GATE: if(it.value() == "Closed") { - gSaveContext.randoSettings[index].value = RO_GENERIC_OFF; + gSaveContext.randoSettings[index].value = RO_KAK_GATE_CLOSED; } else if(it.value() == "Open") { - gSaveContext.randoSettings[index].value = RO_GENERIC_ON; + gSaveContext.randoSettings[index].value = RO_KAK_GATE_OPEN; } break; case RSK_DOOR_OF_TIME: @@ -2561,7 +2561,7 @@ void GenerateRandomizerImgui() { std::unordered_map cvarSettings; cvarSettings[RSK_LOGIC_RULES] = CVar_GetS32("gRandomizeLogicRules", 0); cvarSettings[RSK_FOREST] = CVar_GetS32("gRandomizeForest", 0); - cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", 0); + cvarSettings[RSK_KAK_GATE] = CVar_GetS32("gRandomizeKakarikoGate", RO_KAK_GATE_CLOSED); cvarSettings[RSK_DOOR_OF_TIME] = CVar_GetS32("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED); cvarSettings[RSK_ZORAS_FOUNTAIN] = CVar_GetS32("gRandomizeZorasFountain", 0); cvarSettings[RSK_STARTING_AGE] = CVar_GetS32("gRandomizeStartingAge", 0); @@ -2841,7 +2841,7 @@ void DrawRandoEditor(bool& open) { "Open - The gate is always open. The happy mask shop " "will open immediately after obtaining Zelda's letter." ); - UIWidgets::EnhancementCombobox("gRandomizeKakarikoGate", randoKakarikoGate, 2, RO_GENERIC_DONT_SKIP); + UIWidgets::EnhancementCombobox("gRandomizeKakarikoGate", randoKakarikoGate, 2, RO_KAK_GATE_CLOSED); UIWidgets::PaddedSeparator(); diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 8af56dc70..f079a4f8c 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -1105,6 +1105,10 @@ typedef enum RandoOption { RO_GF_FAST, RO_GF_OPEN, + //Kakariko Gate settings (closed/open) + RO_KAK_GATE_CLOSED = 0, + RO_KAK_GATE_OPEN, + //Rainbow Bridge settings (always open, vanilla, stones, medallions, dungeon rewards, dungeons, tokens) RO_BRIDGE_ALWAYS_OPEN = 0, RO_BRIDGE_VANILLA, diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 822852bd6..43d1712af 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -404,11 +404,8 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { break; } - int kakGate = Randomizer_GetSettingValue(RSK_KAK_GATE); - switch (kakGate) { - case 1: // open - gSaveContext.infTable[7] |= 0x40; - break; + if (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN) { + gSaveContext.infTable[7] |= 0x40; } if(Randomizer_GetSettingValue(RSK_STARTING_KOKIRI_SWORD)) Item_Give(NULL, ITEM_SWORD_KOKIRI); diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index ff5ea2472..8e722c063 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -46,7 +46,7 @@ void BgGateShutter_Init(Actor* thisx, PlayState* play) { this->somePos.z = thisx->world.pos.z; if (((gSaveContext.infTable[7] & 0x40) || (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[4] & 0x20)) || - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_KAK_GATE))) && + (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN))) && (play->sceneNum == SCENE_SPOT01)) { thisx->world.pos.x = -89.0f; thisx->world.pos.z = -1375.0f;