From Slava: "Currently FS_Seek works incorrectly with compressed files from PK3 but this issue isn't noticed because in most cases engine is using FS_LoadFile which reads file sequentially without seeking."
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12564
d7cf8633-e32d-0410-b094-
e92efae38249
buffer = (unsigned char *)Mem_Alloc (tempmempool, buffersize);
// Skip all data until we reach the requested offset
- while (offset > file->position)
+ while (offset > (file->position - file->buff_len + file->buff_ind))
{
- fs_offset_t diff = offset - file->position;
+ fs_offset_t diff = offset - (file->position - file->buff_len + file->buff_ind);
fs_offset_t count, len;
count = (diff > buffersize) ? buffersize : diff;