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)
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

View File

@ -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;