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

Increases inventory storage ItemNum2 to uint16 to fix uint8 overflow #5725

Merged
merged 1 commit into from
May 13, 2024

Conversation

TiberonKalkaz
Copy link
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Per the information provided here and through some discussions with WinterSolstice - determined the underlying packets for inventory storage should be supporting uint16 not uint8.

This matters for Mog House Storage which has a total storage size which can exceed 255.

In a previous PR I resolved the player's available storage space getting truncated to lower than expected values due to uint8 overflow internal to the server. E.g. The player would expect to have 80 storage, and would only have say 10 accessable storage.

This PR ensures the correct values are also sent to the client - where the client uses the information to determine if a player should be allowed to remove placed furniture. When the values sent to the client overflow, players are unable to remove laid out furniture if the client believe the removal would orphan items in storage.
E.g. The player has 266 storage, 4 wells (240), a bookshelf (20), and 6 Aquariums and has 7 items in storage. When overflowing - the client will believe the player only has ~10 available storage space and will incorrectly prevent the removal of the bookshelf and the wells.

Steps to test these changes

  1. Have a player with 4 wells, a bookshelf, and 6 single storage furniture all laid out in their mog house.
  2. They will display as 80 available storage slots.
  3. Add 7 items to storage (and only 7)
  4. Attempt to remove (Layout > select furniture > remove) a well or a bookshelf.
  5. Note that despite having 266 storage - removal of the non-single item furnishings will be prevented

Post this PR
On step 4 - you can remove all large storage items, or all large storage items but 1 if you remove the single item furnishings. Essentially works as intended

@claywar claywar merged commit bbdffc8 into LandSandBoat:base May 13, 2024
12 checks passed
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