Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balanced Shopsanity Bugfix #2640

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

Malkierian
Copy link
Contributor

@Malkierian Malkierian commented Mar 15, 2023

As an unintended consequence of the changes briaguya suggested, and I implemented, in the affordable shopsanity update, it didn't register that the Affordable checkbox in Randomizer Settings retains its enabled or disabled status, so if someone selects Affordable and then changes the price range to Balanced, Affordable is still on, and thus GetPriceAffordable is called even without a wallet range, executing an out of range error. This fixes that.

Build Artifacts

Copy link
Contributor

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a few issues with this:

  • The added condition won't do anything, if Settings::ShopsanityPrices.Is(RO_SHOPSANITY_PRICE_STARTER) then it will by definition not be Settings::ShopsanityPrices.Is(RO_SHOPSANITY_PRICE_BALANCED)
  • Even if that condition did work, we'd still go through the rest of the affordable logic, leading to the same error
  • I tested it and i still got the crash
    image

i think the real fix for this is changing the first couple lines of GetRandomShopPrice to be

    // If Affordable is enabled, and we aren't using balanced prices, don't set max price
    if (Settings::ShopsanityPricesAffordable.Is(true) && Settings::ShopsanityPrices.IsNot(RO_SHOPSANITY_PRICE_BALANCED)) {
        return GetPriceAffordable();
    }

@Malkierian
Copy link
Contributor Author

That's what the fix was supposed to be, I just put it in the wrong spot in my codespace... Why am I so bad at this lately? XD

@briaguya-ai briaguya-ai merged commit 533ee93 into HarbourMasters:develop-khan Mar 16, 2023
@Malkierian Malkierian deleted the shopsanity-fix2 branch March 16, 2023 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants