From 9a5965afa73077e541c4d8bdc49f0729b42c482d Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 7 Jul 2015 20:52:46 +0200 Subject: bugfix: invalidation bsa wasn't created when switching to a profile that needed it invalidation bsa is now always placed as the first bsa --- src/mainwindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ffa044b..466fb1c0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -67,6 +67,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -1312,15 +1313,23 @@ void MainWindow::updateBSAList(const QStringList &defaultArchives, const QString std::vector> items; + IPluginGame *gamePlugin = qApp->property("managed_game").value(); + + BSAInvalidation *invalidation = gamePlugin->feature(); + for (FileEntry::Ptr current : m_OrganizerCore.directoryStructure()->getFiles()) { QFileInfo fileInfo(ToQString(current->getName().c_str())); if (fileInfo.suffix().toLower() == "bsa") { - int index = activeArchives.indexOf(fileInfo.fileName()); + int index = activeArchives.indexOf(fileInfo.fileName()) + 2; if (index == -1) { index = 0xFFFF; } + if ((invalidation != nullptr) && invalidation->isInvalidationBSA(fileInfo.fileName())) { + index = 1; + } + QString basename = fileInfo.baseName(); int originId = current->getOrigin(); FilesOrigin &origin = m_OrganizerCore.directoryStructure()->getOriginByID(originId); -- cgit v1.3.1