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

Fix item quality not defaulting to 20% #8032

Conversation

ConnorThelin
Copy link
Contributor

Fixes #7966 .

Description of the problem being solved:

Due to an incorrect If statement regarding setting quality to nil for Amulets, Belts, etc, items that should have quality set to 20 by default were going into NormaliseQuality() with a nil value for quality, causing it to get set to 0 by default.

Steps taken to verify a working solution:

  • Verify current state, non-quality items had no option for quality, quality items had their default set to 0
  • Make changes
  • Check a non-quality item such as an Amulet, no option to set quality and no visible quality as expected.
  • Check a quality item such as Body Armour, quality is set to 20 as a default.
  • Check several other examples of both cases, behavior as expected for both non-quality and quality items that were tested

Link to a build that showcases this PR:

NA

Before screenshot:

Amulet Example:

Body Armour Example:

After screenshot:

Amulet Example:

Body Armour Example:

Additional Note:
This code still relies on NormalizeQuality() to properly set the default value from 0 to 20 in cases where a default quality is expected. I think it would be pertinent to remove the reliance CraftItem() has on NormalizeQuality() to properly set the default values, unless this behavior is intentional. I can look into this decoupling further if desired.

Corrected the logical error in the if condition to correctly check for specific item types such as Amulet, Belt, Jewel, Quiver, and Ring before setting item quality to nil. This ensures that NormaliseQuality() is able to properly set the default value.
@Paliak Paliak added the bug: behaviour Behavioral differences label Jul 30, 2024
@LocalIdentity LocalIdentity merged commit 004fe35 into PathOfBuildingCommunity:dev Jul 30, 2024
2 checks passed
@LocalIdentity LocalIdentity changed the title Fix quality check condition for item types Fix item quality not defaulting to 20% Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: behaviour Behavioral differences
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set default item quality to 20%
3 participants