From 9bc936053bf9a16f938dab7d87c431e9337d6316 Mon Sep 17 00:00:00 2001 From: 0x3fcf1bbd <81617230+0x3fcf1bbd@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:32:43 +0100 Subject: [PATCH] Fixed STR width & length clamping being incorrect. The main game should however clamp it itself too before sending, so there shouldn't be issues. --- TShockAPI/TSPlayer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 414bc62a..47f4e714 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1345,8 +1345,8 @@ namespace TShockAPI { x = TShock.Utils.Clamp(x, Main.maxTilesX, 0); y = TShock.Utils.Clamp(y, Main.maxTilesY, 0); - width = TShock.Utils.Clamp(x + width, Main.maxTilesX, 1) - x; - length = TShock.Utils.Clamp(y + length, Main.maxTilesY, 1) - x; + width = TShock.Utils.Clamp(x + width, Main.maxTilesX, 0) - x; + length = TShock.Utils.Clamp(y + length, Main.maxTilesY, 0) - x; NetMessage.SendTileSquare(Index, x, y, width, length, changeType); return true; }