delete incomplete map file when download is aborted

(cherry picked from commit github.com/teeworlds/teeworlds/commit/494f74902dcb0271235d3a0831ecd4c6db58b7e9)
This commit is contained in:
Robert Müller 2020-04-12 17:12:20 +02:00 committed by ChillerDragon
parent 3d3c190cd4
commit 2e31cf3258

View file

@ -801,7 +801,10 @@ void CClient::DisconnectWithReason(const char *pReason)
if(m_pMapdownloadTask) if(m_pMapdownloadTask)
m_pMapdownloadTask->Abort(); m_pMapdownloadTask->Abort();
if(m_MapdownloadFile) if(m_MapdownloadFile)
{
io_close(m_MapdownloadFile); io_close(m_MapdownloadFile);
Storage()->RemoveFile(m_aMapdownloadFilename, IStorage::TYPE_SAVE);
}
m_MapdownloadFile = 0; m_MapdownloadFile = 0;
m_MapdownloadSha256Present = false; m_MapdownloadSha256Present = false;
m_MapdownloadSha256 = SHA256_ZEROED; m_MapdownloadSha256 = SHA256_ZEROED;