diff --git a/Source/Plugins/BuilderModes/VisualModes/EffectSRB2ThingVertexSlope.cs b/Source/Plugins/BuilderModes/VisualModes/EffectSRB2ThingVertexSlope.cs index 0d35e1d..ddd33e2 100644 --- a/Source/Plugins/BuilderModes/VisualModes/EffectSRB2ThingVertexSlope.cs +++ b/Source/Plugins/BuilderModes/VisualModes/EffectSRB2ThingVertexSlope.cs @@ -57,7 +57,7 @@ namespace CodeImp.DoomBuilder.BuilderModes if (t.Parameter > 0) position.z = t.GetFlagsValue(); else - position.z += t.Sector.FloorHeight; + position.z = (t.Sector != null) ? t.Sector.FloorHeight : 0; verts[index] = position; index++; if (index > 2) break; //Only the first three vertices are used diff --git a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs index 2163f6d..742ee4d 100644 --- a/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs +++ b/Source/Plugins/BuilderModes/VisualModes/VisualMiddle3D.cs @@ -227,6 +227,9 @@ namespace CodeImp.DoomBuilder.BuilderModes // Anything to see? if(((cl - fl) > 0.01f) || ((cr - fr) > 0.01f)) { + if (extrafloor.Floor == null || extrafloor.Ceiling == null) + return false; + // Keep top and bottom planes for intersection testing top = extrafloor.Floor.plane; bottom = extrafloor.Ceiling.plane;