Only I_Error in HWR_GetTexture with PARANOIA

This commit is contained in:
Lactozilla 2024-02-19 22:55:45 -03:00
parent fe2daf907b
commit 467cc59c64

View file

@ -758,10 +758,15 @@ static void GetMapTexture(INT32 tex, GLMapTexture_t *grtex, GLMipmap_t *mipmap)
GLMapTexture_t *HWR_GetTexture(INT32 tex)
{
if (tex < 0 || tex >= (signed)gl_numtextures)
{
#ifdef PARANOIA
if ((unsigned)tex >= gl_numtextures)
I_Error("HWR_GetTexture: tex >= numtextures\n");
I_Error("HWR_GetTexture: Invalid texture ID %d", tex);
#else
HWR_SetCurrentTexture(NULL);
return;
#endif
}
GLMapTexture_t *grtex = &gl_textures[tex];