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 8901725645
commit cc94145e19

View file

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