Fix R_CacheSpriteBrightMap trying to cache out of range lump

This commit is contained in:
James R 2023-02-14 01:05:48 -08:00
parent badb87697c
commit 9b08730281

View file

@ -1245,7 +1245,14 @@ static patch_t *R_CacheSpriteBrightMap(const spriteinfo_t *sprinfo, UINT8 frame)
name = sprinfo->bright[SPRINFO_DEFAULT_PIVOT];
}
return W_CachePatchNum(W_CheckNumForLongName(name), PU_SPRITE);
const lumpnum_t num = W_CheckNumForLongName(name);
if (num == LUMPERROR)
{
return NULL;
}
return W_CachePatchNum(num, PU_SPRITE);
}
//