RecalculateAvailableChecks Fix - IsSaveLoaded Guard (#5587)

* Added IsSaveLoaded guard clause to RecalculateAvailableChecks.

* Combined RecalculateAvailableChecks guard clauses.
This commit is contained in:
xxAtrain223 2025-06-15 12:22:03 -05:00 committed by GitHub
parent 35361c9e8d
commit 620d08002c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View file

@ -1471,10 +1471,7 @@ static bool AvailableChecksProcessUndiscoveredExitsHandler(std::shared_ptr<Ship:
INFO_MESSAGE("[SOH] Available Checks - Process Undiscovered Exits %s",
logic->ACProcessUndiscoveredExits ? "enabled" : "disabled");
if (GameInteractor::IsSaveLoaded(true)) {
CheckTracker::RecalculateAvailableChecks();
}
CheckTracker::RecalculateAvailableChecks();
return 0;
}

View file

@ -1985,7 +1985,7 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName,
}
void RecalculateAvailableChecks(RandomizerRegion startingRegion /* = RR_ROOT */) {
if (!enableAvailableChecks) {
if (!enableAvailableChecks || !GameInteractor::IsSaveLoaded(true)) {
return;
}
@ -2135,10 +2135,7 @@ void CheckTrackerSettingsWindow::DrawElement() {
"with your current progress.")
.Color(THEME_COLOR))) {
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
if (GameInteractor::IsSaveLoaded(true)) {
RecalculateAvailableChecks();
}
RecalculateAvailableChecks();
}
ImGui::EndDisabled();