From 6e109be0768b6f1d9b9c47dd22d6516d486f4771 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Sat, 17 Feb 2024 04:00:27 -0300 Subject: [PATCH] Fix #1193 --- src/hardware/hw_cache.c | 7 +------ src/p_setup.c | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 58e16d623..55a32114a 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -823,18 +823,13 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum) void HWR_GetLevelFlat(levelflat_t *levelflat) { - if (levelflat->type == LEVELFLAT_NONE) + if (levelflat->type == LEVELFLAT_NONE || levelflat->texture_id < 0) { HWR_SetCurrentTexture(NULL); return; } INT32 texturenum = texturetranslation[levelflat->texture_id]; - if (texturenum <= 0) - { - HWR_SetCurrentTexture(NULL); - return; - } GLMapTexture_t *grtex = &gl_flats[texturenum]; GLMipmap_t *grMipmap = &grtex->mipmap; diff --git a/src/p_setup.c b/src/p_setup.c index 1d985beb4..a39750003 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -585,17 +585,17 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize) // Look for a flat int texturenum = R_CheckFlatNumForName(levelflat->name); - if (texturenum <= 0) + if (texturenum < 0) { // If we can't find a flat, try looking for a texture! texturenum = R_CheckTextureNumForName(levelflat->name); - if (texturenum <= 0) + if (texturenum < 0) { // Use "not found" texture texturenum = R_CheckTextureNumForName("REDWALL"); // Give up? - if (texturenum <= 0) + if (texturenum < 0) { levelflat->type = LEVELFLAT_NONE; texturenum = -1;