Skip CanBuy check when calculating accessible checks, it spoils that some items can't be bought with the current wallet.

This commit is contained in:
Anthony Stewart 2025-02-22 16:34:48 -06:00
commit 999de5b369
3 changed files with 4 additions and 4 deletions

View file

@ -398,7 +398,7 @@ bool AddCheckToLogic(LocationAccess& locPair, GetAccessibleLocationsStruct& gals
Rando::ItemLocation* location = ctx->GetItemLocation(loc); Rando::ItemLocation* location = ctx->GetItemLocation(loc);
RandomizerGet locItem = location->GetPlacedRandomizerGet(); RandomizerGet locItem = location->GetPlacedRandomizerGet();
if (!location->IsAddedToPool() && locPair.ConditionsMet(parentRegion)) { if (!location->IsAddedToPool() && locPair.ConditionsMet(parentRegion, gals.calculatingAccessibleChecks)) {
location->AddToPool(); location->AddToPool();
if (gals.calculatingAccessibleChecks) { if (gals.calculatingAccessibleChecks) {

View file

@ -27,7 +27,7 @@ bool LocationAccess::CheckConditionAtAgeTime(bool& age, bool& time) const {
return GetConditionsMet(); return GetConditionsMet();
} }
bool LocationAccess::ConditionsMet(Region* parentRegion) const { bool LocationAccess::ConditionsMet(Region* parentRegion, bool calculatingAccessibleChecks) const {
//WARNING enterance validation can run this after resetting the access for sphere 0 validation //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 //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 //have any access at all just because this is being run
@ -42,7 +42,7 @@ bool LocationAccess::ConditionsMet(Region* parentRegion) const {
conditionsMet = true; conditionsMet = true;
} }
return conditionsMet && CanBuy(); return conditionsMet && (calculatingAccessibleChecks || CanBuy());
} }
bool LocationAccess::CanBuy() const { bool LocationAccess::CanBuy() const {

View file

@ -75,7 +75,7 @@ class LocationAccess {
bool CheckConditionAtAgeTime(bool& age, bool& time) const; bool CheckConditionAtAgeTime(bool& age, bool& time) const;
bool ConditionsMet(Region* parentRegion) const; bool ConditionsMet(Region* parentRegion, bool calculatingAccessibleChecks) const;
RandomizerCheck GetLocation() const { RandomizerCheck GetLocation() const {
return location; return location;