From 0e9624ace3d328a9859e8e68b5d64bd187eb50d4 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sat, 16 Jul 2011 02:01:48 -0600 Subject: [PATCH] Copied and pasted old region checking code. --- TShockAPI/DB/RegionManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TShockAPI/DB/RegionManager.cs b/TShockAPI/DB/RegionManager.cs index 2786989e..e91ce323 100644 --- a/TShockAPI/DB/RegionManager.cs +++ b/TShockAPI/DB/RegionManager.cs @@ -219,9 +219,11 @@ namespace TShockAPI.DB public bool InArea(int x, int y) { - for (int i = 0; i < Regions.Count; i++) + foreach(Region region in Regions) { - if (Regions[i].InArea(new Rectangle(x, y, 0, 0)) && Regions[i].DisableBuild == 0) + if (x >= region.RegionArea.Left && x <= region.RegionArea.Right && + y >= region.RegionArea.Top && y <= region.RegionArea.Bottom && + region.DisableBuild == 1) { return true; }