From 3638f1a2661d12e39126b7fe2eb3329e1c99b5b3 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 30 Jan 2013 15:40:41 -0500 Subject: [PATCH] Fix patching on MOULa --- .../Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index 7f05f657..ea532ca5 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -83,6 +83,7 @@ public: return fOutput->Write(count, buf); } + plFileName GetFileName() const { return fFilename; } bool IsZipped() const { return fIsZipped; } void Unlink() const { plFileSystem::Unlink(fFilename); } }; @@ -104,16 +105,22 @@ static void FileDownloaded( switch (result) { case kNetSuccess: + { PatcherLog(kStatus, " Download Complete: %s", file.AsString().c_str()); // If this is a PRP, then we need to add it to the ResManager - if (file.AsString().CompareI("prp") == 0) - ((plResManager*)hsgResMgr::ResMgr())->AddSinglePage(file); + plFileName clientPath = static_cast(writer)->GetFileName(); + if (clientPath.GetFileExt().CompareI("prp") == 0) + { + plResManager* clientResMgr = static_cast(hsgResMgr::ResMgr()); + clientResMgr->AddSinglePage(clientPath); + } // Continue down the warpath patcher->IssueRequest(); delete writer; return; + } case kNetErrFileNotFound: PatcherLog(kError, " Download Failed: %s not found", file.AsString().c_str()); break; @@ -125,7 +132,7 @@ static void FileDownloaded( } // Failure case - ((plResDownloadStream*)writer)->Unlink(); + static_cast(writer)->Unlink(); patcher->Finish(false); delete writer; }