fix to vfs seek logic

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1730 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2005-12-21 06:50:57 +00:00
parent 1d13030916
commit 208626a9a2

View file

@ -307,7 +307,7 @@ void W_LoadTextureWadFile (char *filename, int complain)
if (numlumps < 1 || numlumps > TEXWAD_MAXIMAGES)
{Con_Printf ("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);return;}
infotableofs = LittleLong(header.infotableofs);
if (VFS_SEEK(file, infotableofs))
if (!VFS_SEEK(file, infotableofs))
{Con_Printf ("W_LoadTextureWadFile: unable to seek to lump table");return;}
if (!((lumps = Hunk_TempAlloc(sizeof(lumpinfo_t)*numlumps))))
{Con_Printf ("W_LoadTextureWadFile: unable to allocate temporary memory for lump table");return;}
@ -437,7 +437,7 @@ qbyte *W_GetTexture(char *name, int *width, int *height, qboolean *usesalpha)//r
if (!strcmp(texname, texwadlump[i].name)) // found it
{
file = texwadlump[i].file;
if (VFS_SEEK(file, texwadlump[i].position))
if (!VFS_SEEK(file, texwadlump[i].position))
{Con_Printf("W_GetTexture: corrupt WAD3 file");return NULL;}
tex = BZ_Malloc(texwadlump[i].size); //temp buffer for disk info (was hunk_tempalloc, but that wiped loading maps and the like