From d0f45982c16ad1e1683498c4b5aa990b9263b23f Mon Sep 17 00:00:00 2001
From: biwa <6475593+biwa@users.noreply.github.com>
Date: Thu, 22 Apr 2021 18:45:28 +0200
Subject: [PATCH] 3D Floor Mode: fixed a typo in an error message 3D Floor
 Mode: only 3D floors with the "user_managed_3d_floor" field set to true will
 be modified in UDMF maps

---
 Source/Plugins/3DFloorMode/BuilderPlug.cs     | 4 ++++
 Source/Plugins/3DFloorMode/ThreeDFloorMode.cs | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Source/Plugins/3DFloorMode/BuilderPlug.cs b/Source/Plugins/3DFloorMode/BuilderPlug.cs
index e927e323c..86c075608 100644
--- a/Source/Plugins/3DFloorMode/BuilderPlug.cs
+++ b/Source/Plugins/3DFloorMode/BuilderPlug.cs
@@ -769,6 +769,10 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
 			// Build a dictionary of tags used by 3D floor action and which control sector they belong to
 			foreach (Linedef ld in General.Map.Map.Linedefs)
 			{
+				// Make sure the front sector is managed by the 3D floor plugin
+				if (ld.Front == null || ld.Front.Sector == null || ld.Front.Sector.IsDisposed || (General.Map.UDMF && ld.Front.Sector.Fields.GetValue("user_managed_3d_floor", false) == false))
+					continue;
+
 				if (ld.Action == 160 && ld.Args[0] != 0)
 				{
 					if (!tags.ContainsKey(ld.Args[0]))
diff --git a/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs b/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs
index 0aa85e906..c0a0b2d2a 100644
--- a/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs
+++ b/Source/Plugins/3DFloorMode/ThreeDFloorMode.cs
@@ -1533,7 +1533,7 @@ namespace CodeImp.DoomBuilder.ThreeDFloorMode
 			{
 				if (tdf.Sector.BBox.Width > BuilderPlug.Me.ControlSectorArea.SectorSize || tdf.Sector.BBox.Height > BuilderPlug.Me.ControlSectorArea.SectorSize)
 				{
-					General.Interface.DisplayStatus(StatusType.Warning, string.Format("Control sector {0} exceeds horizontal or vertical dimenstion of {1}. Aborted", tdf.Sector.Index, BuilderPlug.Me.ControlSectorArea.SectorSize));
+					General.Interface.DisplayStatus(StatusType.Warning, string.Format("Control sector {0} exceeds horizontal or vertical dimension of {1}. Aborted", tdf.Sector.Index, BuilderPlug.Me.ControlSectorArea.SectorSize));
 					return;
 				}
 			}
-- 
GitLab