Merge branch 'znodes-offset-fix' into 'next'

UDMF: Fix offset calculation for segs that represent linedef backsides

See merge request STJr/SRB2!1701
This commit is contained in:
LJ Sonic 2022-02-06 17:12:58 +00:00
commit 1a1cb8942c

View file

@ -2512,7 +2512,10 @@ static boolean P_LoadExtendedSubsectorsAndSegs(UINT8 **data, nodetype_t nodetype
P_InitializeSeg(seg);
seg->angle = R_PointToAngle2(v1->x, v1->y, v2->x, v2->y);
if (seg->linedef)
segs[i].offset = FixedHypot(v1->x - seg->linedef->v1->x, v1->y - seg->linedef->v1->y);
{
vertex_t *v = (seg->side == 1) ? seg->linedef->v2 : seg->linedef->v1;
segs[i].offset = FixedHypot(v1->x - v->x, v1->y - v->y);
}
seg->length = P_SegLength(seg);
#ifdef HWRENDER
seg->flength = (rendermode == render_opengl) ? P_SegLengthFloat(seg) : 0;