From 65c061383e7550071227009748fcda5fe2fd5920 Mon Sep 17 00:00:00 2001 From: ProfessorXZ Date: Sun, 14 Aug 2016 21:31:30 +0200 Subject: [PATCH] Fixed corrupt packets caused by invalid tile IDs --- CHANGELOG.md | 1 + TShockAPI/GetDataHandlers.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e31dac52..83faaf91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Players can no longer quick stack items into region protected chests (@ProfessorXZ) * Rope placement is no longer blocked by range checks (@ProfessorXZ) * The Drill Containment Unit breaks blocks properly now (@ProfessorXZ) +* Fixed item duplications caused by range checks and invalid netIDs (@ProfessorXZ) * Fixed Expert mode coin duplication (@ProfessorXZ) * Players are no longer able to place liquids using LoadNetModule packet (@ProfessorXZ) * Explosives are no longer blocked by range checks (@ProfessorXZ) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index cd4b7499..0387e9e4 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1907,6 +1907,12 @@ namespace TShockAPI var style = args.Data.ReadInt8(); + if (editData < 0) + { + args.Player.SendTileSquare(tileX, tileY, 4); + return true; + } + if (OnTileEdit(args.Player, tileX, tileY, action, type, editData, style)) return true; if (!TShock.Utils.TilePlacementValid(tileX, tileY))