UDMF Seg length crash fix
Turns out the setup code for UDMF maps wasn't setting
seg->length at all for any segs. This meant that maps of ours we were testing would crash when played in software mode, at the point they encountered the "big room fix" for seg drawing.
@Zwip-Zwap_Zapony started a discussion on the diff
2401 2401 seg->angle = R_PointToAngle2(v1->x, v1->y, v2->x, v2->y); 2402 2402 if (seg->linedef) 2403 2403 segs[i].offset = FixedHypot(v1->x - seg->linedef->v1->x, v1->y - seg->linedef->v1->y); 2404 seg->length = P_SegLength(seg); 2405 #ifdef HWRENDER 2406 seg->flength = (rendermode == render_opengl) ? P_SegLengthFloat(seg) : 0;
This line here will set
seg->flengthto zero if the map is loaded in the software renderer, even if the player switches to OpenGL mid-map, which might cause problems.
That also happens in
P_LoadSegs, which was the place I copied these lines from.
It gets set by
mergedToggle commit list