- crash fix and minor optimization.

This commit is contained in:
Christoph Oelckers 2016-04-20 13:18:53 +02:00
parent 1f32f5a258
commit aa12772e07
2 changed files with 6 additions and 4 deletions

View File

@ -141,11 +141,13 @@ static void AddLine (seg_t *seg, bool portalclip)
}
currentsubsector->flags |= SSECF_DRAWN;
BYTE ispoly = BYTE(seg->sidedef->Flags & WALLF_POLYOBJ);
if (!seg->backsector)
{
clipper.SafeAddClipRange(startAngle, endAngle);
}
else if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) // Two-sided polyobjects never obstruct the view
else if (!ispoly) // Two-sided polyobjects never obstruct the view
{
if (currentsector->sectornum == seg->backsector->sectornum)
{
@ -179,9 +181,9 @@ static void AddLine (seg_t *seg, bool portalclip)
seg->linedef->flags |= ML_MAPPED;
if ((seg->sidedef->Flags & WALLF_POLYOBJ) || seg->linedef->validcount!=validcount)
if (ispoly || seg->linedef->validcount!=validcount)
{
if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) seg->linedef->validcount=validcount;
if (!ispoly) seg->linedef->validcount=validcount;
if (gl_render_walls)
{

View File

@ -1001,7 +1001,7 @@ public:
int GetPortalType(int plane)
{
return SkyBoxes[plane]->special1;
return SkyBoxes[plane] == nullptr? -1 : SkyBoxes[plane]->special1;
}
int GetOppositePortalGroup(int plane)