Fixed STR width & length clamping being incorrect.

The main game should however clamp it itself too before sending, so there shouldn't be issues.
This commit is contained in:
0x3fcf1bbd 2022-02-16 11:32:43 +01:00 committed by GitHub
parent a48bac3631
commit 9bc936053b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1345,8 +1345,8 @@ namespace TShockAPI
{ {
x = TShock.Utils.Clamp(x, Main.maxTilesX, 0); x = TShock.Utils.Clamp(x, Main.maxTilesX, 0);
y = TShock.Utils.Clamp(y, Main.maxTilesY, 0); y = TShock.Utils.Clamp(y, Main.maxTilesY, 0);
width = TShock.Utils.Clamp(x + width, Main.maxTilesX, 1) - x; width = TShock.Utils.Clamp(x + width, Main.maxTilesX, 0) - x;
length = TShock.Utils.Clamp(y + length, Main.maxTilesY, 1) - x; length = TShock.Utils.Clamp(y + length, Main.maxTilesY, 0) - x;
NetMessage.SendTileSquare(Index, x, y, width, length, changeType); NetMessage.SendTileSquare(Index, x, y, width, length, changeType);
return true; return true;
} }