Add some more safeguards to Visual Mode

This commit is contained in:
spherallic 2022-12-19 21:57:31 +01:00
parent bed5298a3f
commit eb28b2aa70
2 changed files with 4 additions and 1 deletions

View file

@ -57,7 +57,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (t.Parameter > 0) if (t.Parameter > 0)
position.z = t.GetFlagsValue(); position.z = t.GetFlagsValue();
else else
position.z += t.Sector.FloorHeight; position.z = (t.Sector != null) ? t.Sector.FloorHeight : 0;
verts[index] = position; verts[index] = position;
index++; index++;
if (index > 2) break; //Only the first three vertices are used if (index > 2) break; //Only the first three vertices are used

View file

@ -227,6 +227,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Anything to see? // Anything to see?
if(((cl - fl) > 0.01f) || ((cr - fr) > 0.01f)) 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 // Keep top and bottom planes for intersection testing
top = extrafloor.Floor.plane; top = extrafloor.Floor.plane;
bottom = extrafloor.Ceiling.plane; bottom = extrafloor.Ceiling.plane;