Get rid of the last case of P_FindSpecialLineFromTag() in the main code.

This commit is contained in:
Nev3r 2020-04-15 10:05:59 +02:00
parent f9b1acb813
commit 7d3d71c418

View file

@ -451,21 +451,25 @@ static void R_AddLine(seg_t *line)
// Portal line // Portal line
if (line->linedef->special == 40 && line->side == 0) if (line->linedef->special == 40 && line->side == 0)
{ {
// Render portal if recursiveness limit hasn't been reached.
// Otherwise, render the wall normally.
if (portalrender < cv_maxportals.value) if (portalrender < cv_maxportals.value)
{ {
// Find the other side! size_t p;
INT32 line2 = P_FindSpecialLineFromTag(40, line->linedef->tag, -1); INT16 tag = line->linedef->tag;
if (line->linedef == &lines[line2]) INT32 li1 = line->linedef-lines;
line2 = P_FindSpecialLineFromTag(40, line->linedef->tag, line2); INT32 li2;
if (line2 >= 0) // found it!
for (p = 0; (li2 = Tag_Iterate_Lines(tag, p)) >= 0; p++)
{ {
Portal_Add2Lines(line->linedef-lines, line2, x1, x2); // Remember the lines for later rendering // Skip invalid lines.
//return; // Don't fill in that space now! if ((tag != lines[li2].tag) || (lines[li1].special != lines[li2].special) || (li1 == li2))
continue;
Portal_Add2Lines(li1, li2, x1, x2);
goto clipsolid; goto clipsolid;
} }
} }
// Recursed TOO FAR (viewing a portal within a portal)
// So uhhh, render it as a normal wall instead or something ???
} }
// Single sided line? // Single sided line?