From 9b87dc71e3734e41caf304b6ef65c8dafbbf0e2b Mon Sep 17 00:00:00 2001
From: MaxED <j.maxed@gmail.com>
Date: Wed, 11 Nov 2015 22:22:21 +0000
Subject: [PATCH] Fixed: in some cases the editor was unable to determine which
 sector a Thing is located in when such thing was placed on top of a linedef
 between 2 rectangular sectors.

---
 Source/Core/Map/Sector.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Source/Core/Map/Sector.cs b/Source/Core/Map/Sector.cs
index 6341c0101..cd0957e43 100644
--- a/Source/Core/Map/Sector.cs
+++ b/Source/Core/Map/Sector.cs
@@ -520,7 +520,8 @@ namespace CodeImp.DoomBuilder.Map
 		// This checks if the given point is inside the sector polygon
 		public bool Intersect(Vector2D p) 
 		{
-			if(!bbox.Contains(p.x, p.y)) return false; //mxd. Check bounding box first
+			//mxd. Check bounding box first
+			if(p.x < bbox.Left || p.x > bbox.Right || p.y < bbox.Top || p.y > bbox.Bottom) return false;
 			
 			uint c = 0;
 			
-- 
GitLab