From b833e4852694152188a5c0fa7359d1909f5e4dc2 Mon Sep 17 00:00:00 2001 From: Jonathan Rascher Date: Mon, 2 Jan 2023 15:38:29 -0600 Subject: [PATCH] Remove unnecessary range check for quick stack --- TShockAPI/TShock.cs | 8 ++------ docs/changelog.md | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 7a5a38af7..65380a523 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -676,17 +676,13 @@ private void OnItemForceIntoChest(ForceItemIntoChestEventArgs args) if (args.Chest != null) { + // After checking for protected regions, no further range checking is necessarily because the client packet only specifies the + // inventory slot to quick stack. The vanilla Terraria server itself determines what chests are close enough to the player. if (Config.Settings.RegionProtectChests && !Regions.CanBuild((int)args.WorldPosition.X, (int)args.WorldPosition.Y, tsplr)) { args.Handled = true; return; } - - if (!tsplr.IsInRange(args.Chest.x, args.Chest.y)) - { - args.Handled = true; - return; - } } } diff --git a/docs/changelog.md b/docs/changelog.md index be96f88c8..7e39da75d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -106,6 +106,7 @@ Use past tense when adding new entries; sign your name off when you add or chang * Allowed multiple test cases to be in TShock's test suite. (@drunderscore) * Fixed unable to use Purification/Evil Powder in jungle. (@sgkoishi) * Set the `GetDataHandledEventArgs.Player` property for the `SyncTilePicking` data handler. (@drunderscore) +* Removed unnecessary range check that artifically shortened quick stack reach. (@boddyn, #2885, @bcat) ## TShock 5.1.3 * Added support for Terraria 1.4.4.9 via OTAPI 3.1.20. (@SignatureBeef)