gl_model.c (Mod_LoadLighting): Check the path_id of the lit file and

accept only if it is coming from the same game directory as for the map
itself.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@372 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-01-02 22:02:11 +00:00
parent e6d0cc36cd
commit 8af0805ee2

View file

@ -634,15 +634,24 @@ void Mod_LoadLighting (lump_t *l)
byte *in, *out, *data;
byte d;
char litfilename[1024];
unsigned int path_id;
loadmodel->lightdata = NULL;
// LordHavoc: check for a .lit file
strcpy(litfilename, loadmodel->name);
COM_StripExtension(litfilename, litfilename);
strcat(litfilename, ".lit");
mark = Hunk_LowMark();
data = (byte*) COM_LoadHunkFile (litfilename, NULL);
data = (byte*) COM_LoadHunkFile (litfilename, &path_id);
if (data)
{
// use lit file only from the same gamedir as the map itself
if (path_id != loadmodel->path_id)
{
Hunk_FreeToLowMark(mark);
Con_DPrintf("%s ignored (not from the same gamedir)\n", litfilename);
}
else
if (data[0] == 'Q' && data[1] == 'L' && data[2] == 'I' && data[3] == 'T')
{
i = LittleLong(((int *)data)[1]);