mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +00:00
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:
parent
e6d0cc36cd
commit
8af0805ee2
1 changed files with 10 additions and 1 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue