From 75d1b49aed1a8a00ffed28455f715a617065dec2 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 2 Apr 2025 09:58:05 +0200 Subject: [PATCH] check if texture exists first --- src/hardware/hw_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 722b262fd..8085bc4fb 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1480,10 +1480,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom } gl_toptexture = R_GetTextureNum(gl_sidedef->toptexture); - gl_bottomtexture = R_GetTextureNum(gl_sidedef->bottomtexture); // check TOP TEXTURE - if ((worldhighslope < worldtopslope || worldhigh < worldtop) && gl_toptexture) + if (gl_toptexture && (worldhighslope < worldtopslope || worldhigh < worldtop)) { // PEGGING if (gl_linedef->flags & ML_DONTPEGTOP) @@ -1542,8 +1541,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom HWR_ProjectWall(wallVerts, &Surf, PF_Masked, lightnum, colormap); } + gl_bottomtexture = R_GetTextureNum(gl_sidedef->bottomtexture); + // check BOTTOM TEXTURE - if ((worldlowslope > worldbottomslope || worldlow > worldbottom) && gl_bottomtexture) + if (gl_bottomtexture && (worldlowslope > worldbottomslope || worldlow > worldbottom)) { // PEGGING if (!(gl_linedef->flags & ML_DONTPEGBOTTOM))