From 4ba3d206a01329ff0b8de2da046f17501d5140c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 13 Apr 2020 23:23:05 +0200 Subject: [PATCH] also remove incomplete map when restarting download (cherry picked from commit https://github.com/teeworlds/teeworlds/commit/b67b55448ad1fdb76e5a0d89133589c287ba5e48) --- src/engine/client/client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index d12f5c926..4184703be 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -457,7 +457,10 @@ void CClient::SendReady() void CClient::SendMapRequest() { if(m_MapdownloadFile) + { io_close(m_MapdownloadFile); + Storage()->RemoveFile(m_aMapdownloadFilename, IStorage::TYPE_SAVE); + } m_MapdownloadFile = Storage()->OpenFile(m_aMapdownloadFilename, IOFLAG_WRITE, IStorage::TYPE_SAVE); CMsgPacker Msg(NETMSG_REQUEST_MAP_DATA, true); Msg.AddInt(m_MapdownloadChunk);