Fix R_DrawColumnShadowed_8 crash encountered in FuriousFox's map

If you want more specifics, sloped FOFs are to blame it turns out: sometimes the bottom of an FOF wall blocking a segment of an in-level wall column can be considered ABOVE the top part of the FOF there (yikes), and then the dc_y* values go offscreen, and then BOOM
This commit is contained in:
Monster Iestyn 2016-07-24 18:54:01 +01:00
parent 03ddc1f29a
commit dc765cde2c

View file

@ -1363,7 +1363,19 @@ void R_DrawColumnShadowed_8(void)
height = dc_lightlist[i].height >> LIGHTSCALESHIFT; height = dc_lightlist[i].height >> LIGHTSCALESHIFT;
if (solid) if (solid)
{
bheight = dc_lightlist[i].botheight >> LIGHTSCALESHIFT; bheight = dc_lightlist[i].botheight >> LIGHTSCALESHIFT;
if (bheight < height)
{
// confounded slopes sometimes allow partial invertedness,
// even including cases where the top and bottom heights
// should actually be the same!
// swap the height values as a workaround for this quirk
INT32 temp = height;
height = bheight;
bheight = temp;
}
}
if (height <= dc_yl) if (height <= dc_yl)
{ {
dc_colormap = dc_lightlist[i].rcolormap; dc_colormap = dc_lightlist[i].rcolormap;