Skip to content

Conversation

@jprzimba
Copy link
Collaborator

@jprzimba jprzimba commented Oct 9, 2025

Optimized Game::unwrapItem by minimizing repeated attribute fetches, deferring reads, and simplifying amount handling, without changing behavior.

Charges:

  • I avoided repeated readings of attributes: OWNER, AMOUNT, DATE are read once.
  • Defer reading of DATE only when isCaskItem(unWrapId) is true.
  • I simplified the amount calculation with fallback to 1.
  • Maintained existing flow and effects: owner validation, bed check, transformItem, add bed, remove temporary attributes, start decay, restore OWNER, apply hiddenCharges to casks.

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.

2 participants