@@ -328,7 +328,8 @@ struct ModThread
328
328
int prio = -1 ;
329
329
std::vector<std::wstring> archives;
330
330
std::set<std::wstring> enabledArchives;
331
- DirectoryStats* stats = nullptr ;
331
+ std::vector<std::wstring>* loadOrder = nullptr ;
332
+ DirectoryStats* stats = nullptr ;
332
333
env::DirectoryWalker walker;
333
334
334
335
std::condition_variable cv;
@@ -356,18 +357,8 @@ struct ModThread
356
357
ds->addFromOrigin (walker, modName, path, prio, *stats);
357
358
358
359
if (Settings::instance ().archiveParsing ()) {
359
- QStringList loadOrder;
360
- auto gamePlugins = gameFeatures->gameFeature <GamePlugins>();
361
- if (gamePlugins) {
362
- loadOrder = gamePlugins->getLoadOrder ();
363
- }
364
-
365
- std::vector<std::wstring> lo;
366
- for (auto && s : loadOrder) {
367
- lo.push_back (s.toStdWString ());
368
- }
369
-
370
- ds->addFromAllBSAs (modName, path, prio, archives, enabledArchives, lo, *stats);
360
+ ds->addFromAllBSAs (modName, path, prio, archives, enabledArchives, *loadOrder,
361
+ *stats);
371
362
}
372
363
373
364
if (progress) {
@@ -400,6 +391,18 @@ void DirectoryRefresher::addMultipleModsFilesToStructure(
400
391
log::debug (" refresher: using {} threads" , m_threadCount);
401
392
g_threads.setMax (m_threadCount);
402
393
394
+ std::vector<std::wstring> loadOrder;
395
+ if (Settings::instance ().archiveParsing ()) {
396
+ auto gamePlugins = m_Core.gameFeatures ().gameFeature <GamePlugins>();
397
+ if (gamePlugins) {
398
+ QStringList lo = gamePlugins->getLoadOrder ();
399
+ loadOrder.reserve (lo.size ());
400
+ for (auto && s : lo) {
401
+ loadOrder.push_back (s.toStdWString ());
402
+ }
403
+ }
404
+ }
405
+
403
406
for (std::size_t i = 0 ; i < entries.size (); ++i) {
404
407
const auto & e = entries[i];
405
408
const int prio = e.priority + 1 ;
@@ -436,7 +439,8 @@ void DirectoryRefresher::addMultipleModsFilesToStructure(
436
439
mt.enabledArchives .insert (a.toStdWString ());
437
440
}
438
441
439
- mt.stats = &stats[i];
442
+ mt.loadOrder = &loadOrder;
443
+ mt.stats = &stats[i];
440
444
441
445
mt.wakeup ();
442
446
}
0 commit comments