mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-09 00:12:56 +00:00
WADNAME Zone Builder temporary file detection made stricter
- Only apply if the format is \Temp\8\8.3 - Only apply if there's a previous loaded file with WADNAME - Use that filename - Add a DBG_SETUP print Fixes \Temp\SLADE\(actual filename) files popped out from maps.pk3
This commit is contained in:
parent
0f16c61d04
commit
f5f8456979
1 changed files with 16 additions and 4 deletions
20
src/w_wad.c
20
src/w_wad.c
|
|
@ -451,20 +451,30 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
|
|||
trimname = strrchr(filename, PATHSEP[0]);
|
||||
#if defined (_WIN32)
|
||||
// For Zone Builder support, work around temporary filenames.
|
||||
if (trimname != 0)
|
||||
// They're annoyingly randomised, BUT they follow \Temp\8\8.3...
|
||||
// AND they're always guaranteed to follow the map file, which
|
||||
// should already have a WADNAME in it for us to piggyback off.
|
||||
// EXAMPLE: // \Temp\gj3l7w7n\4f926789.wad
|
||||
|
||||
if (trimname != 0
|
||||
&& wadnamelump != LUMPERROR
|
||||
&& strlen(trimname+1) == 8+1+3)
|
||||
{
|
||||
const char *temp = trimname-1;
|
||||
while (temp >= filename+5 && *temp != PATHSEP[0])
|
||||
temp--;
|
||||
|
||||
if (temp-filename >= 5 && !strncmp(temp-5, PATHSEP"Temp", 5))
|
||||
if (((trimname-1) - temp) == 8
|
||||
&& temp >= filename+5
|
||||
&& !strncmp(temp-5, PATHSEP"Temp", 5))
|
||||
{
|
||||
filename = wadfiles[numwadfiles-1]->filename;
|
||||
filename = wadfiles[
|
||||
((wadnamelump & ~UINT16_MAX) >> 16)
|
||||
]->filename;
|
||||
trimname = strrchr(filename, PATHSEP[0]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Strip away file address
|
||||
if (trimname != 0)
|
||||
trimname++;
|
||||
|
|
@ -482,6 +492,8 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
|
|||
strncpy(lump_p->longname, trimname, namelen);
|
||||
lump_p->longname[namelen-1] = '\0';
|
||||
|
||||
CONS_Debug(DBG_SETUP, "WADNAME handling:\n -- path %s\n -- interpreted lumpname %s\n", filename, lump_p->longname);
|
||||
|
||||
// Grab the hash from the first part
|
||||
lump_p->hash = quickncasehash(lump_p->longname, 8);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue