Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

`/slap` is unable to hit rightwards #2941

Open Arthri opened 1 year ago

Arthri commented 1 year ago

Reproduction steps (if applicable)?

  1. /slap player
  2. /slap player
  3. /slap player
  4. Player is only takes left knockback or none

Any stack traces or error messages (if known)?

N/A

Any screenshots?

f

https://github.com/Pryaxis/TShock/blob/2c06e2bdf5d3057aaaaf7588519ce9ee305d7079/TShockAPI/Commands.cs#L4615 https://github.com/Pryaxis/TShock/blob/2c06e2bdf5d3057aaaaf7588519ce9ee305d7079/TShockAPI/TSPlayer.cs#L1818 The above line of code uses (new Random()).Next(-1, 1) to determine the hit direction, however the upper bound is exclusive, so only the numbers -1(left knockback) and 0(no knockback) are being generated

Any log messages from files that end in .log or .txt? What are the last 100 log messages from the server console?

N/A

What plugins and what versions of those plugins are you running?

TShockAPI only