From 097ef0a8e8f56c97a060e91c6d34f80b20b868a5 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 19 Oct 2010 21:06:05 +0200 Subject: [PATCH] Changed: #1051 ForceRemovePatchCategories is using a bad index --- code/ryzom/client/src/login_patch.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/login_patch.cpp b/code/ryzom/client/src/login_patch.cpp index 655f0221b..3a8cac886 100644 --- a/code/ryzom/client/src/login_patch.cpp +++ b/code/ryzom/client/src/login_patch.cpp @@ -1132,14 +1132,20 @@ void CPatchManager::readDescFile(sint32 nVersion) } } + CBNPFileSet &bnpFS = const_cast(DescFile.getFiles()); + for(cat = 0; cat < DescFile.getCategories().categoryCount();) { + const CBNPCategory &bnpCat = DescFile.getCategories().getCategory(cat); + if (std::find(ForceRemovePatchCategories.begin(), ForceRemovePatchCategories.end(), - DescFile.getCategories().getCategory(cat).getName()) != ForceRemovePatchCategories.end()) + bnpCat.getName()) != ForceRemovePatchCategories.end()) { - std::string fileName = DescFile.getCategories().getFile(cat); - CBNPFileSet &bnpFS = const_cast(DescFile.getFiles()); - bnpFS.removeFile(fileName); + for(uint file = 0; file < bnpCat.fileCount(); ++file) + { + std::string fileName = bnpCat.getFile(file); + bnpFS.removeFile(fileName); + } const_cast(DescFile.getCategories()).deleteCategory(cat); } else