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

Quick Stack range is shortened by range check #2885

Closed
boddyn opened this issue Dec 29, 2022 · 1 comment · Fixed by #2888
Closed

Quick Stack range is shortened by range check #2885

boddyn opened this issue Dec 29, 2022 · 1 comment · Fixed by #2888

Comments

@boddyn
Copy link

boddyn commented Dec 29, 2022

  • TShock version: 5.1.3.0

  • TShock build number (if known):

  • Description of issue:
    In the current version of Terraria (1.4.4.9 PC), and I believe since 1.4.4, the range for quick stacking to nearby chests is ~37. This is verified by both the wiki and my own personal tests.
    However, on servers using TShock, the quick stack range is maximally 32 by my own measurements.

  • Expected problem and fix:
    Quick stack range check
    IsInRange
    The code at the first link runs when a player tries to quick stack. If the chest is not in range, it returns without allowing the player.
    The function IsInRange is called without a supplied value for range, and so defaults to 32. Adding a range value of, say, 40 on line 685 should fix this issue.

Reproduction steps (if applicable)?

  1. Go to an isolated area.
  2. Place a chest down and place gray bricks in it, leaving some in your personal inventory.
  3. Walk a distance away using the ruler tool.
  4. While, say, 35 tiles away, open your inventory.
  5. Click the "Quick Stack to Nearby Chests" button.
  6. Observe that the gray bricks in your inventory do not quick stack to the chest.

Any stack traces or error messages (if known)?

None, nor would I expect any.

Any screenshots?

image
Fig. 1 - Showing setup of inventories.
image
Fig. 2 - At range of 35 tiles, quick stacking to nearby chests does not work.
image
Fig. 3 - Now at a range of 32.
image
Fig. 4 - At the range of 32, you can now quick stack to the chest.

@sgkoishi
Copy link
Contributor

sgkoishi commented Dec 30, 2022

Actually, this check is unnecessary. The client only sends the slot, and the server determines which chest to use and checks for the range (Distance(player, chest) < 600) before this hook.

600 = 37.5 tiles

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 a pull request may close this issue.

2 participants