Merge branch 'fix-1193' into 'next'

Fix #1193

Closes #1193

See merge request STJr/SRB2!2330
This commit is contained in:
sphere 2024-02-18 14:42:42 +00:00
commit 6d645acbc8
2 changed files with 4 additions and 9 deletions

View file

@ -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;

View file

@ -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;