diff --git a/soh/soh/Enhancements/randomizer/3drando/menu.cpp b/soh/soh/Enhancements/randomizer/3drando/menu.cpp index f7699b7541..4f0d7b7d59 100644 --- a/soh/soh/Enhancements/randomizer/3drando/menu.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/menu.cpp @@ -516,12 +516,12 @@ void PrintOptionDescription() { printf("\x1b[22;0H%s", description.data()); } -std::string GenerateRandomizer(std::unordered_map cvarSettings) { +std::string GenerateRandomizer(std::unordered_map cvarSettings, std::set excludedLocations) { // if a blank seed was entered, make a random one srand(time(NULL)); Settings::seed = std::to_string(rand()); - int ret = Playthrough::Playthrough_Init(std::hash{}(Settings::seed), cvarSettings); + int ret = Playthrough::Playthrough_Init(std::hash{}(Settings::seed), cvarSettings, excludedLocations); if (ret < 0) { if (ret == -1) { // Failed to generate after 5 tries printf("\n\nFailed to generate after 5 tries.\nPress B to go back to the menu.\nA different seed might be " diff --git a/soh/soh/Enhancements/randomizer/3drando/menu.hpp b/soh/soh/Enhancements/randomizer/3drando/menu.hpp index 737c1d3cfa..6be641f034 100644 --- a/soh/soh/Enhancements/randomizer/3drando/menu.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/menu.hpp @@ -2,6 +2,7 @@ #include #include +#include #include "soh/Enhancements/randomizer/randomizerTypes.h" #define MAIN_MENU 0 @@ -45,7 +46,7 @@ void PrintResetToDefaultsMenu(); void PrintGenerateMenu(); void ClearDescription(); void PrintOptionDescription(); -std::string GenerateRandomizer(std::unordered_map cvarSettings); +std::string GenerateRandomizer(std::unordered_map cvarSetting, std::set excludedLocations); std::string GetInput(const char* hintText); extern void MenuInit(); diff --git a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp index cfcbdfa917..ee1a864242 100644 --- a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp @@ -10,7 +10,7 @@ namespace Playthrough { -int Playthrough_Init(uint32_t seed, std::unordered_map cvarSettings) { +int Playthrough_Init(uint32_t seed, std::unordered_map cvarSettings, std::set excludedLocations) { // initialize the RNG with just the seed incase any settings need to be // resolved to something random Random_Init(seed); @@ -21,7 +21,7 @@ int Playthrough_Init(uint32_t seed, std::unordered_map cvarSettings); +int Playthrough_Init(uint32_t seed, std::unordered_map cvarSettings, std::set excludedLocations); int Playthrough_Repeat(int count = 1); } diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index 5fb1b34c5e..56e84dd1e9 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -13,7 +13,7 @@ #define TICKS_PER_SEC 268123480.0 -void RandoMain::GenerateRando(std::unordered_map cvarSettings) { +void RandoMain::GenerateRando(std::unordered_map cvarSettings, std::set excludedLocations) { HintTable_Init(); ItemTable_Init(); LocationTable_Init(); @@ -21,7 +21,7 @@ void RandoMain::GenerateRando(std::unordered_map cvarS // std::string settingsFileName = "./randomizer/latest_settings.json"; // CVar_SetString("gLoadedPreset", settingsFileName.c_str()); - std::string fileName = Ship::GlobalCtx2::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings).c_str()); + std::string fileName = Ship::GlobalCtx2::GetPathRelativeToAppDirectory(GenerateRandomizer(cvarSettings, excludedLocations).c_str()); CVar_SetString("gSpoilerLog", fileName.c_str()); CVar_Save(); diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.hpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.hpp index 523620d1e1..b70762cf7c 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.hpp @@ -1,5 +1,5 @@ #pragma once namespace RandoMain { -void GenerateRando(std::unordered_map cvarSettings); +void GenerateRando(std::unordered_map cvarSettings, std::set excludedLocations); } diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 71aa70b323..1d35727245 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -2483,7 +2483,7 @@ namespace Settings { } //Function to set flags depending on settings - void UpdateSettings(std::unordered_map cvarSettings) { + void UpdateSettings(std::unordered_map cvarSettings, std::set excludedLocations) { // RANDTODO: Switch this back once all logic options are implemented // Logic.SetSelectedIndex(cvarSettings[RSK_LOGIC_RULES]); diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.hpp b/soh/soh/Enhancements/randomizer/3drando/settings.hpp index 06ec9da1c2..2daf1fa7f1 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.hpp @@ -850,7 +850,7 @@ class Menu { }; namespace Settings { -void UpdateSettings(std::unordered_map cvarSettings); +void UpdateSettings(std::unordered_map cvarSettings, std::set excludedLocations); SettingsContext FillContext(); void InitSettings(); void SetDefaultSettings(); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 281dc98e47..0de33baf40 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3587,7 +3587,9 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_SKULLS_SUNS_SONG] = CVar_GetS32("gRandomizeGsExpectSunsSong", 0); - RandoMain::GenerateRando(cvarSettings); + std::set excludedLocations = { RC_UNKNOWN_CHECK }; + + RandoMain::GenerateRando(cvarSettings, excludedLocations); CVar_SetS32("gRandoGenerating", 0); CVar_Save();