From 21b57c10097f97e8956b5e2cc85716215ff6fd9b Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 13 Oct 2024 02:46:04 +0200 Subject: [PATCH] this uhhh actually makes things crash lol --- src/r_things.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index d31ef67be..8848fdbb1 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -617,6 +617,7 @@ void R_DrawMaskedColumn(column_t *column) dc_yh = mfloorclip[dc_x]-1; if (dc_yl <= mceilingclip[dc_x]) dc_yl = mceilingclip[dc_x]+1; + if (dc_yl < 0) dc_yl = 0; if (dc_yh >= vid.height) @@ -633,6 +634,10 @@ void R_DrawMaskedColumn(column_t *column) // quick fix... something more proper should be done!!! if (ylookup[dc_yl]) colfunc(); +#ifdef PARANOIA + else + I_Error("R_DrawMaskedColumn: Invalid ylookup for dc_yl %d", dc->yl); +#endif } column = (column_t *)((UINT8 *)column + column->length + 4); } @@ -845,14 +850,6 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->x2 >= vid.width) vis->x2 = vid.width-1; - // Something is occasionally setting 1px-wide sprites whose frac is exactly the width of the sprite, causing crashes due to - // accessing invalid column info. Until the cause is found, let's try to correct those manually... - { - fixed_t temp = ((frac + vis->xiscale*(vis->x2-vis->x1))>>FRACBITS) - SHORT(patch->width); - if (temp > 0) - vis->x2 -= temp; - } - localcolfunc = (vis->vflip) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn; lengthcol = patch->height;