--- src/pengine/physfs_rw.cpp +++ src/pengine/physfs_rw.cpp @@ -13,26 +13,20 @@ { PHYSFS_file *pfile = (PHYSFS_file *)context->hidden.unknown.data1; - int target; - - int curpos = PHYSFS_tell(pfile); - switch (whence) { default: case SEEK_SET: - target = offset; + PHYSFS_seek(pfile, offset); break; case SEEK_CUR: - target = curpos + offset; + PHYSFS_seek(pfile, PHYSFS_tell(pfile) + offset); break; case SEEK_END: - target = PHYSFS_fileLength(pfile) + offset; + PHYSFS_seek(pfile, PHYSFS_fileLength(pfile) + offset); break; } - PHYSFS_seek(pfile, target); - - return curpos; + return PHYSFS_tell(pfile); }