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 committed by NepDisk
parent a87c060c4a
commit d622a49f08

View file

@ -1232,7 +1232,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);
}
//