Reject lit files if they're the wrong size (eg hipnotic/start.bsp vs id1/start.lit or just a bsp that no longer has any coloured lits, etc).

From Spike.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1654 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
ewasylishen 2019-11-20 02:47:04 +00:00
parent 39669b94e6
commit d40ff71625

View file

@ -731,9 +731,14 @@ void Mod_LoadLighting (lump_t *l)
i = LittleLong(((int *)data)[1]);
if (i == 1)
{
Con_DPrintf2("%s loaded\n", litfilename);
loadmodel->lightdata = data + 8;
return;
if (8+l->filelen*3 == com_filesize)
{
Con_DPrintf2("%s loaded\n", litfilename);
loadmodel->lightdata = data + 8;
return;
}
Hunk_FreeToLowMark(mark);
Con_Printf("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize);
}
else
{