From 4e542d6ef68c5bb18d0e67c048fd86f17c9c3253 Mon Sep 17 00:00:00 2001 From: punchready <22683812+punchready@users.noreply.github.com> Date: Wed, 19 Oct 2022 05:20:18 +0200 Subject: [PATCH] Skip tile rect changes close to the world edge --- TShockAPI/Handlers/SendTileRectHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Handlers/SendTileRectHandler.cs b/TShockAPI/Handlers/SendTileRectHandler.cs index 883eff51..607cba03 100644 --- a/TShockAPI/Handlers/SendTileRectHandler.cs +++ b/TShockAPI/Handlers/SendTileRectHandler.cs @@ -157,8 +157,9 @@ namespace TShockAPI.Handlers int realY = tileY + y; // Do not process tiles outside of the world boundaries - if ((realX < 0 || realX >= Main.maxTilesX) - || (realY < 0 || realY > Main.maxTilesY)) + // The hidden world strip is 40 tiles wide/tall, use 10 instead just to be safe to avoid off-by-one errors + if ((realX < 10 || realX >= Main.maxTilesX - 10) + || (realY < 10 || realY > Main.maxTilesY - 10)) { processed[x, y] = true; continue;