diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -586,9 +586,7 @@ void ClientNetworkContentSocketHandler:: this->http_response_index = -2; if (this->curFile != nullptr) { - /* Revert the download progress when we are going for the old system. */ - long size = ftell(this->curFile); - if (size > 0) this->OnDownloadProgress(this->curInfo, (int)-size); + this->OnDownloadProgress(this->curInfo, -1); fclose(this->curFile); this->curFile = nullptr; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -100,7 +100,7 @@ static WindowDesc _network_content_downl ); BaseNetworkContentDownloadStatusWindow::BaseNetworkContentDownloadStatusWindow(WindowDesc *desc) : - Window(desc), cur_id(UINT32_MAX) + Window(desc), downloaded_bytes(0), downloaded_files(0), cur_id(UINT32_MAX) { _network_content_client.AddCallback(this); _network_content_client.DownloadSelectedContent(this->total_files, this->total_bytes); @@ -174,7 +174,13 @@ void BaseNetworkContentDownloadStatusWin this->downloaded_files++; } - this->downloaded_bytes += bytes; + /* A negative value means we are resetting; for example, when retrying or using a fallback. */ + if (bytes < 0) { + this->downloaded_bytes = 0; + } else { + this->downloaded_bytes += bytes; + } + this->SetDirty(); }