From 549a2e63aad851167b04fa94afb4f374e037308c Mon Sep 17 00:00:00 2001 From: cracker64 Date: Wed, 15 Jun 2016 09:19:18 -0400 Subject: [PATCH] Properly follow tileData for region checks. Fix #1159 --- TShockAPI/GetDataHandlers.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index ff4a9b5f..202ea39c 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2231,12 +2231,8 @@ namespace TShockAPI if (tileData == null) return true; - if (tileData.Width == 3 && tileData.Height == 2) { x -= 1; y -= 1; } - else if (tileData.Width == 4 && tileData.Height == 2) { x -= 1; y -= 1; } - else if (tileData.Width == 6 && tileData.Height == 3) { x -= 2; y -= 2; } - else if (tileData.Width == 6 && tileData.Height == 4) { x -= 2; y -= 3; } - else if (tileData.Width == 3 && tileData.Height == 3) { x -= 1; y -= 2; } - else if (tileData.Width == 3 && tileData.Height == 4) { x -= 1; y -= 3; } + x -= tileData.Origin.X; + y -= tileData.Origin.Y; for (int i = x; i < x + tileData.Width; i++) {