void CL_StopDownload(int size, int crc)
{
- if (cls.qw_downloadmemory && cls.qw_downloadmemorycursize == size && CRC_Block(cls.qw_downloadmemory, size) == crc)
+ if (cls.qw_downloadmemory && cls.qw_downloadmemorycursize == size && CRC_Block(cls.qw_downloadmemory, cls.qw_downloadmemorycursize) == crc)
{
int existingcrc;
size_t existingsize;
FS_Rescan();
}
}
+ else if (cls.qw_downloadmemory && size)
+ {
+ Con_Printf("Download \"%s\" is corrupt (%i bytes, %i CRC, should be %i bytes, %i CRC), discarding\n", cls.qw_downloadname, size, crc, (int)cls.qw_downloadmemorycursize, (int)CRC_Block(cls.qw_downloadmemory, cls.qw_downloadmemorycursize));
+ CL_BeginDownloads(true);
+ }
if (cls.qw_downloadmemory)
Mem_Free(cls.qw_downloadmemory);