Skip to content

Wrong value in player shot packet structure #312

@NoobMajesty

Description

@NoobMajesty

Describe the bug
When using a player shop(store item) and 2 players join the shop if the first player leaves the shop it will close the second player’s shop as well

To Reproduce
Steps to reproduce the behavior:

  1. Open a player store with 1 client
  2. Open another 2 client and join the shop
  3. Leave the shop if the first player in the shop

Expected behavior
Only the first player should be removed fron the shop

This happens due to wrong value in packet creator.
In packet creator at getPlayerShop you will see

p.writeByte(owner ? 0 : 1);

which is actually the player slot on the client side, it needs to be the visitor position, also the positions on client are actually 0,1,2,3, 0 being the shop owner, the bug happens cause all of the players gets the same slot (1) so if slot 1 leaves all the client thinks it is they who should close the shop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions