diff options
| author | Garrett Cox <garrettjcox@gmail.com> | 2026-01-24 13:50:39 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-24 13:50:39 -0600 |
| commit | f1dee0072680609f60282bbb235718f1c444cdd5 (patch) | |
| tree | aba9714187543aee171f9050eb50db8d1ff7c8d3 | |
| parent | 1e57e04d44fda7a44629a8e5db5637300016a2e7 (diff) | |
Fix a glitchless gen issue, tweak logging, and tweak metrics (#1500)
| -rw-r--r-- | mm/2s2h/Rando/Logic/GlitchlessLogic.cpp | 17 | ||||
| -rw-r--r-- | mm/2s2h/Rando/Menu.cpp | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/mm/2s2h/Rando/Logic/GlitchlessLogic.cpp b/mm/2s2h/Rando/Logic/GlitchlessLogic.cpp index c00652fd8..a9fadb032 100644 --- a/mm/2s2h/Rando/Logic/GlitchlessLogic.cpp +++ b/mm/2s2h/Rando/Logic/GlitchlessLogic.cpp @@ -122,9 +122,12 @@ void ApplyGlitchlessLogicToSaveContext(std::vector<RandoCheckId>& checkPool, std Rando::StaticData::Items[randoItemId].randoItemType == RITYPE_HEALTH) { checksWithJunk.push_back(randoCheckId); checksWithJunkWeights.push_back(weight); + SPDLOG_TRACE("Item Placed: {}:{}", Rando::StaticData::Checks[randoCheckId].name, + Rando::StaticData::Items[randoItemId].spoilerName); + } else { + SPDLOG_DEBUG("Item Placed: {}:{}", Rando::StaticData::Checks[randoCheckId].name, + Rando::StaticData::Items[randoItemId].spoilerName); } - SPDLOG_TRACE("Check: {}:{}", Rando::StaticData::Checks[randoCheckId].name, - Rando::StaticData::Items[randoItemId].spoilerName); } GiveItem(ConvertItem(randoItemId)); @@ -169,6 +172,8 @@ void ApplyGlitchlessLogicToSaveContext(std::vector<RandoCheckId>& checkPool, std if (checksWithJunk.size() == 1) { checkWithJunk = checksWithJunk[0]; + checksWithJunk.pop_back(); + checksWithJunkWeights.pop_back(); } else { std::vector<double> cumulativeWeights(checksWithJunkWeights.size()); std::partial_sum(checksWithJunkWeights.begin(), checksWithJunkWeights.end(), @@ -183,6 +188,9 @@ void ApplyGlitchlessLogicToSaveContext(std::vector<RandoCheckId>& checkPool, std checksWithJunk.erase(checksWithJunk.begin() + index); checksWithJunkWeights.erase(checksWithJunkWeights.begin() + index); } + + SPDLOG_DEBUG("Nothing changed, attempting to replace check: {}", + Rando::StaticData::Checks[checkWithJunk].name); } std::vector<std::pair<RandoItemId, int>> nonJunkItemsThatWeHaveNotTried; @@ -216,6 +224,9 @@ void ApplyGlitchlessLogicToSaveContext(std::vector<RandoCheckId>& checkPool, std RANDO_SAVE_CHECKS[checkWithJunk].randoItemId = newRandoItemId; + SPDLOG_DEBUG("Item Replaced Junk: {}:{}", Rando::StaticData::Checks[checkWithJunk].name, + Rando::StaticData::Items[newRandoItemId].spoilerName); + RemoveItem(oldRandoItemId); GiveItem(ConvertItem(newRandoItemId)); @@ -228,7 +239,7 @@ void ApplyGlitchlessLogicToSaveContext(std::vector<RandoCheckId>& checkPool, std } else { weight++; if (checkWithJunk != RC_UNKNOWN) { - SPDLOG_TRACE("Successfully Replaced junk item with: {}:{}", + SPDLOG_DEBUG("Successfully Replaced junk item with: {}:{}", Rando::StaticData::Checks[checkWithJunk].name, Rando::StaticData::Items[RANDO_SAVE_CHECKS[checkWithJunk].randoItemId].spoilerName); } diff --git a/mm/2s2h/Rando/Menu.cpp b/mm/2s2h/Rando/Menu.cpp index b0b63dc35..29796a91d 100644 --- a/mm/2s2h/Rando/Menu.cpp +++ b/mm/2s2h/Rando/Menu.cpp @@ -148,6 +148,8 @@ void SaveExcludedChecks() { excludedString += ","; } CVarSetString("gRando.ExcludedChecks", excludedString.c_str()); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + ShipInit::Init("gRando.ExcludedChecks"); } void LoadExcludedChecks() { @@ -211,6 +213,7 @@ void RefreshMetrics() { static RegisterShipInitFunc refreshMetricsInit(RefreshMetrics, { // I Don't love this, but it works... + "gRando.ExcludedChecks", "gRando.Options.RO_ACCESS_DUNGEONS", "gRando.Options.RO_ACCESS_MAJORA_MASKS_COUNT", "gRando.Options.RO_ACCESS_MAJORA_REMAINS_COUNT", |
