mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 05:43:42 -07:00
Rename Accessible Checks to Available Checks.
This commit is contained in:
parent
931d0e1600
commit
2cce99aaf9
11 changed files with 69 additions and 69 deletions
|
@ -1408,8 +1408,8 @@ static bool SfxHandler(std::shared_ptr<Ship::Console> Console, const std::vector
|
|||
return 0;
|
||||
}
|
||||
|
||||
static bool RecalculateAccessibleChecksHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
|
||||
CheckTracker::RecalculateAccessibleChecks();
|
||||
static bool RecalculateAvailableChecksHandler(std::shared_ptr<Ship::Console> Console, const std::vector<std::string>& args, std::string* output) {
|
||||
CheckTracker::RecalculateAvailableChecks();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1602,7 +1602,7 @@ void DebugConsole_Init(void) {
|
|||
{"group_name", Ship::ArgumentType::TEXT, true},
|
||||
}});
|
||||
|
||||
CMD_REGISTER("recalculate_accessible_checks", {RecalculateAccessibleChecksHandler, "Recalculate accessible checks."});
|
||||
CMD_REGISTER("recalculate_available_checks", {RecalculateAvailableChecksHandler, "Recalculate available checks."});
|
||||
|
||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ typedef enum {
|
|||
PT_TOD_ACCESS,
|
||||
PT_ENTRANCE_LOGIC,
|
||||
PT_LOCATION_LOGIC,
|
||||
PT_RECALCULATE_ACCESSIBLE_CHECKS,
|
||||
PT_RECALCULATE_AVAILABLE_CHECKS,
|
||||
PT_MAX
|
||||
} TimerID;
|
||||
|
||||
|
|
|
@ -396,8 +396,8 @@ bool AddCheckToLogic(LocationAccess& locPair, GetAccessibleLocationsStruct& gals
|
|||
Rando::ItemLocation* location = ctx->GetItemLocation(loc);
|
||||
RandomizerGet locItem = location->GetPlacedRandomizerGet();
|
||||
|
||||
if (!location->IsAddedToPool() && locPair.ConditionsMet(parentRegion, gals.calculatingAccessibleChecks)) {
|
||||
if (gals.calculatingAccessibleChecks) {
|
||||
if (!location->IsAddedToPool() && locPair.ConditionsMet(parentRegion, gals.calculatingAvailableChecks)) {
|
||||
if (gals.calculatingAvailableChecks) {
|
||||
gals.accessibleLocations.push_back(loc);
|
||||
StopPerformanceTimer(PT_LOCATION_LOGIC);
|
||||
return false;
|
||||
|
@ -498,19 +498,19 @@ void ProcessRegion(Region* region, GetAccessibleLocationsStruct& gals, Randomize
|
|||
}
|
||||
|
||||
// Return any of the targetLocations that are accessible in logic
|
||||
std::vector<RandomizerCheck> ReachabilitySearch(const std::vector<RandomizerCheck>& targetLocations, RandomizerGet ignore /* = RG_NONE*/, bool calculatingAccessibleChecks /* = false */) {
|
||||
std::vector<RandomizerCheck> ReachabilitySearch(const std::vector<RandomizerCheck>& targetLocations, RandomizerGet ignore /* = RG_NONE*/, bool calculatingAvailableChecks /* = false */) {
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
GetAccessibleLocationsStruct gals(0);
|
||||
gals.calculatingAccessibleChecks = calculatingAccessibleChecks;
|
||||
ResetLogic(ctx, gals, !calculatingAccessibleChecks);
|
||||
gals.calculatingAvailableChecks = calculatingAvailableChecks;
|
||||
ResetLogic(ctx, gals, !calculatingAvailableChecks);
|
||||
do {
|
||||
gals.InitLoop();
|
||||
for (size_t i = 0; i < gals.regionPool.size(); i++) {
|
||||
ProcessRegion(RegionTable(gals.regionPool[i]), gals, ignore);
|
||||
}
|
||||
} while (gals.logicUpdated);
|
||||
erase_if(gals.accessibleLocations, [&targetLocations, ctx, calculatingAccessibleChecks](RandomizerCheck loc) {
|
||||
if (ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() != RG_NONE && !calculatingAccessibleChecks) {
|
||||
erase_if(gals.accessibleLocations, [&targetLocations, ctx, calculatingAvailableChecks](RandomizerCheck loc) {
|
||||
if (ctx->GetItemLocation(loc)->GetPlacedRandomizerGet() != RG_NONE && !calculatingAvailableChecks) {
|
||||
return false;
|
||||
}
|
||||
for (RandomizerCheck allowedLocation : targetLocations) {
|
||||
|
|
|
@ -34,7 +34,7 @@ struct GetAccessibleLocationsStruct {
|
|||
std::vector<RandomizerCheck> itemSphere;
|
||||
std::list<Rando::Entrance*> entranceSphere;
|
||||
|
||||
bool calculatingAccessibleChecks = false;
|
||||
bool calculatingAvailableChecks = false;
|
||||
|
||||
GetAccessibleLocationsStruct(int _maxGsCount){
|
||||
regionPool = {RR_ROOT};
|
||||
|
@ -64,7 +64,7 @@ std::vector<RandomizerCheck> GetEmptyLocations(std::vector<RandomizerCheck> allo
|
|||
void ProcessRegion(Region* region, GetAccessibleLocationsStruct& gals, RandomizerGet ignore = RG_NONE,
|
||||
bool stopOnBeatable = false, bool addToPlaythrough = false);
|
||||
|
||||
std::vector<RandomizerCheck> ReachabilitySearch(const std::vector<RandomizerCheck>& allowedLocations, RandomizerGet ignore=RG_NONE, bool calculatingAccessibleChecks=false);
|
||||
std::vector<RandomizerCheck> ReachabilitySearch(const std::vector<RandomizerCheck>& allowedLocations, RandomizerGet ignore=RG_NONE, bool calculatingAvailableChecks=false);
|
||||
|
||||
void GeneratePlaythrough();
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ void RandomizerOnItemReceiveHandler(GetItemEntry receivedItemEntry) {
|
|||
loc->SetCheckStatus(RCSHOW_COLLECTED);
|
||||
CheckTracker::SpoilAreaFromCheck(randomizerQueuedCheck);
|
||||
CheckTracker::RecalculateAllAreaTotals();
|
||||
CheckTracker::RecalculateAccessibleChecks();
|
||||
CheckTracker::RecalculateAvailableChecks();
|
||||
SaveManager::Instance->SaveSection(gSaveContext.fileNum, SECTION_ID_TRACKER_DATA, true);
|
||||
randomizerQueuedCheck = RC_UNKNOWN_CHECK;
|
||||
randomizerQueuedItemEntry = GET_ITEM_NONE;
|
||||
|
|
|
@ -228,14 +228,14 @@ void ItemLocation::ResetVariables() {
|
|||
areas = {};
|
||||
status = RCSHOW_UNCHECKED;
|
||||
isSkipped = false;
|
||||
isAccessible = false;
|
||||
isAvailable = false;
|
||||
}
|
||||
|
||||
bool ItemLocation::IsAccessible() const {
|
||||
return isAccessible;
|
||||
bool ItemLocation::IsAvailable() const {
|
||||
return isAvailable;
|
||||
}
|
||||
|
||||
void ItemLocation::SetAccessible(bool isAccessible_) {
|
||||
isAccessible = isAccessible_;
|
||||
void ItemLocation::SetAvailable(bool isAvailable_) {
|
||||
isAvailable = isAvailable_;
|
||||
}
|
||||
}
|
|
@ -56,8 +56,8 @@ class ItemLocation {
|
|||
bool IsFoolishCandidate() const;
|
||||
void SetBarrenCandidate();
|
||||
void ResetVariables();
|
||||
bool IsAccessible() const;
|
||||
void SetAccessible(bool isAccessible_);
|
||||
bool IsAvailable() const;
|
||||
void SetAvailable(bool isAvailable_);
|
||||
|
||||
private:
|
||||
RandomizerCheck rc;
|
||||
|
@ -78,6 +78,6 @@ class ItemLocation {
|
|||
bool barrenCandidate = false;
|
||||
RandomizerCheckStatus status = RCSHOW_UNCHECKED;
|
||||
bool isSkipped = false;
|
||||
bool isAccessible = false;
|
||||
bool isAvailable = false;
|
||||
};
|
||||
} // namespace Rando
|
|
@ -32,7 +32,7 @@ bool LocationAccess::CheckConditionAtAgeTime(bool& age, bool& time) const {
|
|||
return GetConditionsMet();
|
||||
}
|
||||
|
||||
bool LocationAccess::ConditionsMet(Region* parentRegion, bool calculatingAccessibleChecks) const {
|
||||
bool LocationAccess::ConditionsMet(Region* parentRegion, bool calculatingAvailableChecks) const {
|
||||
//WARNING enterance validation can run this after resetting the access for sphere 0 validation
|
||||
//When refactoring ToD access, either fix the above or do not assume that we
|
||||
//have any access at all just because this is being run
|
||||
|
@ -47,7 +47,7 @@ bool LocationAccess::ConditionsMet(Region* parentRegion, bool calculatingAccessi
|
|||
conditionsMet = true;
|
||||
}
|
||||
|
||||
return conditionsMet && (calculatingAccessibleChecks || CanBuy());
|
||||
return conditionsMet && (calculatingAvailableChecks || CanBuy());
|
||||
}
|
||||
|
||||
bool LocationAccess::CanBuy() const {
|
||||
|
|
|
@ -75,7 +75,7 @@ class LocationAccess {
|
|||
|
||||
bool CheckConditionAtAgeTime(bool& age, bool& time) const;
|
||||
|
||||
bool ConditionsMet(Region* parentRegion, bool calculatingAccessibleChecks) const;
|
||||
bool ConditionsMet(Region* parentRegion, bool calculatingAvailableChecks) const;
|
||||
|
||||
RandomizerCheck GetLocation() const {
|
||||
return location;
|
||||
|
|
|
@ -131,10 +131,10 @@ bool areasFullyChecked[RCAREA_INVALID];
|
|||
u32 areasSpoiled = 0;
|
||||
bool showVOrMQ;
|
||||
s8 areaChecksGotten[RCAREA_INVALID]; //| "Kokiri Forest (4/9)"
|
||||
s8 areaChecksAccessible[RCAREA_INVALID];
|
||||
s8 areaChecksAvailable[RCAREA_INVALID];
|
||||
s8 areaCheckTotals[RCAREA_INVALID];
|
||||
uint16_t totalChecks = 0;
|
||||
uint16_t totalChecksAccessible = 0;
|
||||
uint16_t totalChecksAvailable = 0;
|
||||
uint16_t totalChecksGotten = 0;
|
||||
bool optCollapseAll; // A bool that will collapse all checks once
|
||||
bool optExpandAll; // A bool that will expand all checks once
|
||||
|
@ -237,12 +237,12 @@ void TrySetAreas() {
|
|||
|
||||
void CalculateTotals() {
|
||||
totalChecks = 0;
|
||||
totalChecksAccessible = 0;
|
||||
totalChecksAvailable = 0;
|
||||
totalChecksGotten = 0;
|
||||
|
||||
for (uint8_t i = 0; i < RCAREA_INVALID; i++) {
|
||||
totalChecks += areaCheckTotals[i];
|
||||
totalChecksAccessible += areaChecksAccessible[i];
|
||||
totalChecksAvailable += areaChecksAvailable[i];
|
||||
totalChecksGotten += areaChecksGotten[i];
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ uint16_t GetTotalChecksGotten() {
|
|||
|
||||
void RecalculateAreaTotals(RandomizerCheckArea rcArea) {
|
||||
areaChecksGotten[rcArea] = 0;
|
||||
areaChecksAccessible[rcArea] = 0;
|
||||
areaChecksAvailable[rcArea] = 0;
|
||||
areaCheckTotals[rcArea] = 0;
|
||||
for (auto rc : checksByArea.at(rcArea)) {
|
||||
if (!IsVisibleInCheckTracker(rc)) {
|
||||
|
@ -266,8 +266,8 @@ void RecalculateAreaTotals(RandomizerCheckArea rcArea) {
|
|||
areaCheckTotals[rcArea]++;
|
||||
if (OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->GetIsSkipped() || OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->HasObtained()) {
|
||||
areaChecksGotten[rcArea]++;
|
||||
} else if (OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->IsAccessible()) {
|
||||
areaChecksAccessible[rcArea]++;
|
||||
} else if (OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->IsAvailable()) {
|
||||
areaChecksAvailable[rcArea]++;
|
||||
}
|
||||
}
|
||||
CalculateTotals();
|
||||
|
@ -315,7 +315,7 @@ void SetCheckCollected(RandomizerCheck rc) {
|
|||
if (IsVisibleInCheckTracker(rc)) {
|
||||
if (!OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->GetIsSkipped()) {
|
||||
areaChecksGotten[loc->GetArea()]++;
|
||||
areaChecksAccessible[loc->GetArea()]--;
|
||||
areaChecksAvailable[loc->GetArea()]--;
|
||||
} else {
|
||||
OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->SetIsSkipped(false);
|
||||
}
|
||||
|
@ -432,12 +432,12 @@ void ClearAreaChecksAndTotals() {
|
|||
for (auto& [rcArea, vec] : checksByArea) {
|
||||
vec.clear();
|
||||
areaChecksGotten[rcArea] = 0;
|
||||
areaChecksAccessible[rcArea] = 0;
|
||||
areaChecksAvailable[rcArea] = 0;
|
||||
areaCheckTotals[rcArea] = 0;
|
||||
}
|
||||
totalChecks = 0;
|
||||
totalChecksGotten = 0;
|
||||
totalChecksAccessible = 0;
|
||||
totalChecksAvailable = 0;
|
||||
}
|
||||
|
||||
void SetShopSeen(uint32_t sceneNum, bool prices) {
|
||||
|
@ -479,8 +479,8 @@ void CheckTrackerLoadGame(int32_t fileNum) {
|
|||
if (loc->GetCheckStatus() == RCSHOW_SAVED || loc->GetIsSkipped()) {
|
||||
areaChecksGotten[entry2->GetArea()]++;
|
||||
}
|
||||
if (loc->IsAccessible()) {
|
||||
areaChecksAccessible[entry2->GetArea()]++;
|
||||
if (loc->IsAvailable()) {
|
||||
areaChecksAvailable[entry2->GetArea()]++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ void CheckTrackerLoadGame(int32_t fileNum) {
|
|||
UpdateAllOrdering();
|
||||
UpdateInventoryChecks();
|
||||
UpdateFilters();
|
||||
RecalculateAccessibleChecks();
|
||||
RecalculateAvailableChecks();
|
||||
}
|
||||
|
||||
void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) {
|
||||
|
@ -549,7 +549,7 @@ void CheckTrackerShopSlotChange(uint8_t cursorSlot, int16_t basePrice) {
|
|||
if (status == RCSHOW_SEEN) {
|
||||
OTRGlobals::Instance->gRandoContext->GetItemLocation(slot)->SetCheckStatus(RCSHOW_IDENTIFIED);
|
||||
SaveManager::Instance->SaveSection(gSaveContext.fileNum, sectionId, true);
|
||||
RecalculateAccessibleChecks();
|
||||
RecalculateAvailableChecks();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -824,7 +824,7 @@ void SaveTrackerData(SaveContext* saveContext, int sectionID, bool fullSave) {
|
|||
void SaveFile(SaveContext* saveContext, int sectionID, bool fullSave) {
|
||||
SaveTrackerData(saveContext, sectionID, fullSave);
|
||||
if (fullSave) {
|
||||
RecalculateAccessibleChecks();
|
||||
RecalculateAvailableChecks();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -978,7 +978,7 @@ void CheckTrackerWindow::DrawElement() {
|
|||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Text("Total Checks: %d Available / %d Checked / %d Total", totalChecksAccessible, totalChecksGotten, totalChecks);
|
||||
ImGui::Text("Total Checks: %d Available / %d Checked / %d Total", totalChecksAvailable, totalChecksGotten, totalChecks);
|
||||
|
||||
UIWidgets::PaddedSeparator();
|
||||
|
||||
|
@ -1031,7 +1031,7 @@ void CheckTrackerWindow::DrawElement() {
|
|||
}
|
||||
if ((shouldHideFilteredAreas && filterAreasHidden[rcArea]) ||
|
||||
(!showHidden && ((hideComplete && thisAreaFullyChecked) || (hideIncomplete && !thisAreaFullyChecked))) ||
|
||||
(onlyShowAvailable && areaChecksAccessible[rcArea] == 0)
|
||||
(onlyShowAvailable && areaChecksAvailable[rcArea] == 0)
|
||||
) {
|
||||
doDraw = false;
|
||||
} else {
|
||||
|
@ -1072,14 +1072,14 @@ void CheckTrackerWindow::DrawElement() {
|
|||
if (isThisAreaSpoiled) {
|
||||
if (showVOrMQ && RandomizerCheckObjects::AreaIsDungeon(rcArea)) {
|
||||
if (OTRGlobals::Instance->gRandoContext->GetDungeons()->GetDungeonFromScene(DungeonSceneLookupByArea(rcArea))->IsMQ()) {
|
||||
ImGui::Text("(%d / %d / %d) - MQ", areaChecksAccessible[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
ImGui::Text("(%d / %d / %d) - MQ", areaChecksAvailable[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
UIWidgets::Tooltip("Available / Checked / Total");
|
||||
} else {
|
||||
ImGui::Text("(%d / %d / %d) - Vanilla", areaChecksAccessible[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
ImGui::Text("(%d / %d / %d) - Vanilla", areaChecksAvailable[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
UIWidgets::Tooltip("Available / Checked / Total");
|
||||
}
|
||||
} else {
|
||||
ImGui::Text("(%d / %d / %d)", areaChecksAccessible[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
ImGui::Text("(%d / %d / %d)", areaChecksAvailable[rcArea], areaChecksGotten[rcArea], areaCheckTotals[rcArea]);
|
||||
UIWidgets::Tooltip("Available / Checked / Total");
|
||||
}
|
||||
} else {
|
||||
|
@ -1095,7 +1095,7 @@ void CheckTrackerWindow::DrawElement() {
|
|||
}
|
||||
for (auto rc : checks) {
|
||||
if (doDraw && isThisAreaSpoiled && !filterChecksHidden[rc] &&
|
||||
(!onlyShowAvailable || OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->IsAccessible())) {
|
||||
(!onlyShowAvailable || OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->IsAvailable())) {
|
||||
DrawLocation(rc);
|
||||
}
|
||||
}
|
||||
|
@ -1529,7 +1529,7 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
Rando::ItemLocation* itemLoc = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
RandomizerCheckStatus status = itemLoc->GetCheckStatus();
|
||||
bool skipped = itemLoc->GetIsSkipped();
|
||||
bool accessible = itemLoc->IsAccessible();
|
||||
bool available = itemLoc->IsAvailable();
|
||||
if (status == RCSHOW_COLLECTED) {
|
||||
if (!showHidden && hideCollected) {
|
||||
return;
|
||||
|
@ -1606,17 +1606,17 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->SetIsSkipped(false);
|
||||
areaChecksGotten[loc->GetArea()]--;
|
||||
totalChecksGotten--;
|
||||
if (accessible) {
|
||||
areaChecksAccessible[loc->GetArea()]++;
|
||||
totalChecksAccessible++;
|
||||
if (available) {
|
||||
areaChecksAvailable[loc->GetArea()]++;
|
||||
totalChecksAvailable++;
|
||||
}
|
||||
} else {
|
||||
OTRGlobals::Instance->gRandoContext->GetItemLocation(rc)->SetIsSkipped(true);
|
||||
areaChecksGotten[loc->GetArea()]++;
|
||||
totalChecksGotten++;
|
||||
if (accessible) {
|
||||
areaChecksAccessible[loc->GetArea()]--;
|
||||
totalChecksAccessible--;
|
||||
if (available) {
|
||||
areaChecksAvailable[loc->GetArea()]--;
|
||||
totalChecksAvailable--;
|
||||
}
|
||||
}
|
||||
UpdateOrdering(loc->GetArea());
|
||||
|
@ -1637,7 +1637,7 @@ void DrawLocation(RandomizerCheck rc) {
|
|||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, styleColor);
|
||||
}
|
||||
ImGui::Text("%s", accessible ? ICON_FA_UNLOCK : ICON_FA_LOCK);
|
||||
ImGui::Text("%s", available ? ICON_FA_UNLOCK : ICON_FA_LOCK);
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::SameLine();
|
||||
|
||||
|
@ -1791,47 +1791,47 @@ void ImGuiDrawTwoColorPickerSection(const char* text, const char* cvarMainName,
|
|||
UIWidgets::PopStyleCombobox();
|
||||
}
|
||||
|
||||
void RecalculateAccessibleChecks() {
|
||||
StartPerformanceTimer(PT_RECALCULATE_ACCESSIBLE_CHECKS);
|
||||
void RecalculateAvailableChecks() {
|
||||
StartPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS);
|
||||
|
||||
std::vector<RandomizerCheck> targetLocations;
|
||||
targetLocations.reserve(RR_MAX);
|
||||
for (auto& location : Rando::StaticData::GetLocationTable()) {
|
||||
RandomizerCheck rc = location.GetRandomizerCheck();
|
||||
Rando::ItemLocation* itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
itemLocation->SetAccessible(false);
|
||||
itemLocation->SetAvailable(false);
|
||||
if (!itemLocation->HasObtained()) {
|
||||
targetLocations.emplace_back(rc);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<RandomizerCheck> accessibleChecks = ReachabilitySearch(targetLocations, RG_NONE, true);
|
||||
for (auto& rc : accessibleChecks) {
|
||||
std::vector<RandomizerCheck> availableChecks = ReachabilitySearch(targetLocations, RG_NONE, true);
|
||||
for (auto& rc : availableChecks) {
|
||||
const auto& location = Rando::StaticData::GetLocation(rc);
|
||||
const auto& itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
if (location->GetRCType() == RCTYPE_SHOP && itemLocation->GetCheckStatus() == RCSHOW_IDENTIFIED) {
|
||||
if (CanBuyAnother(rc)) {
|
||||
itemLocation->SetAccessible(true);
|
||||
itemLocation->SetAvailable(true);
|
||||
}
|
||||
} else {
|
||||
itemLocation->SetAccessible(true);
|
||||
itemLocation->SetAvailable(true);
|
||||
}
|
||||
}
|
||||
|
||||
totalChecksAccessible = 0;
|
||||
totalChecksAvailable = 0;
|
||||
for (auto& [rcArea, vec] : checksByArea) {
|
||||
areaChecksAccessible[rcArea] = 0;
|
||||
areaChecksAvailable[rcArea] = 0;
|
||||
for (auto& rc : vec) {
|
||||
Rando::ItemLocation* itemLocation = OTRGlobals::Instance->gRandoContext->GetItemLocation(rc);
|
||||
if (itemLocation->IsAccessible() && !itemLocation->GetIsSkipped() && !itemLocation->HasObtained() && IsVisibleInCheckTracker(rc)) {
|
||||
areaChecksAccessible[rcArea]++;
|
||||
if (itemLocation->IsAvailable() && !itemLocation->GetIsSkipped() && !itemLocation->HasObtained() && IsVisibleInCheckTracker(rc)) {
|
||||
areaChecksAvailable[rcArea]++;
|
||||
}
|
||||
}
|
||||
totalChecksAccessible += areaChecksAccessible[rcArea];
|
||||
totalChecksAvailable += areaChecksAvailable[rcArea];
|
||||
}
|
||||
|
||||
StopPerformanceTimer(PT_RECALCULATE_ACCESSIBLE_CHECKS);
|
||||
SPDLOG_INFO("Recalculate Accessible Checks Time: {}ms", GetPerformanceTimer(PT_RECALCULATE_ACCESSIBLE_CHECKS).count());
|
||||
StopPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS);
|
||||
SPDLOG_INFO("Recalculate Available Checks Time: {}ms", GetPerformanceTimer(PT_RECALCULATE_AVAILABLE_CHECKS).count());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -61,5 +61,5 @@ void UpdateAllOrdering();
|
|||
void UpdateAllAreas();
|
||||
void RecalculateAllAreaTotals();
|
||||
void SpoilAreaFromCheck(RandomizerCheck rc);
|
||||
void RecalculateAccessibleChecks();
|
||||
void RecalculateAvailableChecks();
|
||||
} // namespace CheckTracker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue