check if texture exists first

This commit is contained in:
Alug committed 2025-04-02 18:42:44 +02:00
1 parent a5421d1a51
commit 75d1b49aed
1 file changed
+4 -3
+4 -3
View File
@@ -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))