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

Item duplication through dragging #235

Closed
Supersonic159 opened this issue Dec 13, 2023 · 3 comments
Closed

Item duplication through dragging #235

Supersonic159 opened this issue Dec 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Supersonic159
Copy link

Describe the bug
Item A replaces item B and inherits the stack number. Duplicating item A.

To Reproduce
Steps to reproduce the behavior:
Take item A (quantity 10), drag it over item B (quantity 7), place it, item B is now gone, you now have two stacks of item A (10 and 7). Item A replaces item B and inherits the stack number.

Screenshots
image

@Supersonic159 Supersonic159 added the bug Something isn't working label Dec 13, 2023
@abitofBaileys
Copy link

abitofBaileys commented Feb 12, 2024

The dupe brought another issue to light: integer underflowing, which makes you able to get a stack of 65,486 items of your choice. Furthermore, you can transfer that stack beyond the Item Bag Stack Maximum (IBSM) to your Storage, allowing you to mass sell the item at 999 times per sell transaction.

Steps to reproduce

  1. Get an item with a high IBSM (e.g. kindlings at 99)
    image
  2. Get a 2nd item with a low IBSM and high sell value (e. g. Cure-All)
    image
  3. Drag the item with the low IBSM over the one with the high IBSM and swap them
    image image
  4. You now have a duped item
    image
  5. Discard the original low IBSM stack completely
    image
  6. You now have 65486 (displayed number) of the duped item.
    image
  7. Access your Storage Box, send 1 of the original low IBSM stack to your left box
    image
  8. Send the duped item to the left box (the image is not accurate in numbers here, this is the 65k+ one)
    image
  9. Send the duped item in the left box back to the right box (image not accurate in numbers, this should be 11)
    image
  10. You now have the 65k+ stack in your Storage Box.
    image
  11. Shift select the whole stack in your Storage Box, select Sell, confirm, repeat xN. Once depleted, the stack will fill back to 65k+ again.
    image

@abitofBaileys
Copy link

abitofBaileys commented Feb 12, 2024

Attempting to provide more information what happens on client and what on server side. Relogs done after every step:

Initial dupe using 99 kindlings and 1 Miracle Cure (See step 4 above), after relog

image
You end up with 2 stacks with 10 of each

After discarding (step 5), before relog

image

After discarding, after relog

image

After sending 1 of the original low IBSM stack to your left box (step 7), before relog

image
Yes, the 1 gets subtracted from the DUPED item, not the original item. Possible memory pointer issue.

After sending, after relog

image

After sending duped to left box + back (steps 8+), before relog

image

After sending, after relog

image

After selling the storage box stack (step 11), before relog

image

After selling, after relog

image

Further testing, using an already duped stack

After relog

image

After selling 999 pieces, before relog

image

After selling, after relog

image

We can assume that most of this issue happens on the client side and at various points bypasses server side validation. When doing the integer underflow, the server (allegedly) accepts that invalid stack number. After relogging, the 999 stack size is purely visual and 999 is likely set when the client initializes the game and/or storage, despite the stack size being negative (and thus, much higher).

The initial dupe still happens (steps 1-4)

Server-side: Both stacks are (allegedly) set to the IBSM of the duped item
Client-side: Miscalculation or wrong memory pointer issue

Discarding the original IBSM item (steps 5-6)

Server-side: Both stacks are still set to ISBM
Client-side: (allegedly) adds half a stack to the duped item. Can hint at said memory pointer issue.

@alborrajo
Copy link
Collaborator

Fixed in PR #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants