mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-29 15:08:07 +03:00
TEX_InitFromWad: Fix reversing mistake (Don't add file handle before check)
This commit is contained in:
parent
63fde229c9
commit
a7b60451f3
@ -109,10 +109,10 @@ qboolean TEX_InitFromWad(char *path)
|
|||||||
#endif // REHLDS_FIXES
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
texfile = FS_Open(wadPath, "rb");
|
texfile = FS_Open(wadPath, "rb");
|
||||||
texfiles[nTexFiles++] = texfile;
|
|
||||||
if (!texfile)
|
if (!texfile)
|
||||||
Sys_Error("%s: couldn't open %s\n", __func__, wadPath);
|
Sys_Error("%s: couldn't open %s\n", __func__, wadPath);
|
||||||
|
|
||||||
|
texfiles[nTexFiles++] = texfile;
|
||||||
Con_DPrintf("Using WAD File: %s\n", wadPath);
|
Con_DPrintf("Using WAD File: %s\n", wadPath);
|
||||||
SafeRead(texfile, &header, 12);
|
SafeRead(texfile, &header, 12);
|
||||||
if (Q_strncmp(header.identification, "WAD2", 4) && Q_strncmp(header.identification, "WAD3", 4))
|
if (Q_strncmp(header.identification, "WAD2", 4) && Q_strncmp(header.identification, "WAD3", 4))
|
||||||
@ -147,8 +147,9 @@ void TEX_CleanupWadInfo(void)
|
|||||||
|
|
||||||
for (int i = 0; i < nTexFiles; i++)
|
for (int i = 0; i < nTexFiles; i++)
|
||||||
{
|
{
|
||||||
|
if (texfiles[i])
|
||||||
FS_Close(texfiles[i]);
|
FS_Close(texfiles[i]);
|
||||||
texfiles[i] = 0;
|
texfiles[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
nTexLumps = 0;
|
nTexLumps = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user