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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1654 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2019-11-20 02:47:04 +00:00
parent 799b48d3f8
commit 361c66d06a

View file

@ -731,9 +731,14 @@ void Mod_LoadLighting (lump_t *l)
i = LittleLong(((int *)data)[1]); i = LittleLong(((int *)data)[1]);
if (i == 1) if (i == 1)
{ {
Con_DPrintf2("%s loaded\n", litfilename); if (8+l->filelen*3 == com_filesize)
loadmodel->lightdata = data + 8; {
return; 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 else
{ {