From be6ac1d91e1ba0f51a59d20de61c18e4cdae8a97 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 1 Jul 2017 21:38:57 -0400 Subject: [PATCH] workaround for incorrect 404 save --- src/gui/preview/PreviewModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index e68a84445..dc61a6be7 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -233,6 +233,20 @@ bool PreviewModel::ParseSaveInfo(char * saveInfoResponse) saveInfo->Favourite = tempFavourite; saveInfo->Views = tempViews; saveInfo->Version = tempVersion; + + // This is a workaround for a bug on the TPT server where the wrong 404 save is returned + // Redownload the .cps file for a fixed version of the 404 save + if (tempID == 404 && this->saveID != 404) + { + if (saveDataDownload) + saveDataDownload->Cancel(); + delete saveData; + saveData = NULL; + std::stringstream urlStream; + urlStream << "http://" << STATICSERVER << "/2157797.cps"; + saveDataDownload = new Download(urlStream.str()); + saveDataDownload->Start(); + } return true; } catch (std::exception &e)