#ifdef RANGECHECK
if (num>=numsubsectors)
I_Error ("P_CrossSubsector: ss %i with numss = %i", num,
numsubsectors);
#endif
sub = &subsectors[num];
// check lines
count = sub->numlines;
seg = &segs[sub->firstline];
for ( ; count ; seg++, count--)
{
line = seg->linedef;
// allready checked other side?
if (line->validcount == validcount) continue;
line->validcount = validcount;
v1 = line->v1;
v2 = line->v2;
s1 = P_DivlineSide (v1->x,v1->y, &strace); s2 = P_DivlineSide (v2->x, v2->y, &strace);
// line isn’t crossed? if (s1 == s2)
continue;
divl.x = v1->x; divl.y = v1->y;
divl.dx = v2->x - v1->x; divl.dy = v2->y - v1->y;
s1 = P_DivlineSide (strace.x, strace.y, &divl);
s2 = P_DivlineSide (t2x, t2y, &divl);
//line isn’t crossed? if (s1 == s2)
continue;
//stop because it is not two sided anyway
//might do this after updating validcount? if ( !(line->flags & ML_TWOSIDED) )
return false;
//crosses a two sided line
front = seg->frontsector; back = seg->backsector;
// no wall to block sight with?
if (front->floorheight == back->floorheight
&& front->ceilingheight == back->ceilingheight) continue;
//possible occluder
//because of ceiling height differences
if (front->ceilingheight < back->ceilingheight) opentop = front->ceilingheight;
else
opentop = back->ceilingheight;