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: imbuement check for empty slots #3370

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

dudantas
Copy link
Member

Description

This PR improves the handling of imbuement slots by checking if a slot is empty before attempting to retrieve imbuement information. Previously, the function getImbuementInfo would return an invalid imbuement even when the slot was empty. Now, it ensures that only valid imbuements are considered.

Behaviour

Actual

  • An item with an empty imbuement slot still attempted to retrieve imbuement data.
  • Invalid imbuements were being logged as missing but were not removed from the item.
  • Items could retain invalid imbuements due to incorrect validation.

Expected

  • The function getImbuementInfo now checks if the slot has an associated custom attribute.
  • If the slot does not have a custom attribute, the function returns false immediately, avoiding unnecessary operations.
  • If an invalid imbuement ID is found, it is now automatically removed from the item, preventing redundant warnings.

Fixes #issuenumber

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

Tests performed:

  • Checked an item with and without imbuements to ensure correct validation.
  • Verified that items without any imbuements correctly return false in getImbuementInfo.
  • Ensured that invalid imbuements are removed and logged correctly.
  • Tested various imbuement slot scenarios to confirm expected behavior.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@majestyotbr majestyotbr merged commit ff78b2c into main Feb 17, 2025
33 checks passed
@majestyotbr majestyotbr deleted the dudantas/check-imbuements-slots branch February 17, 2025 18:45
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.

3 participants