Skip to content

Commit

Permalink
Update CCC parsing to ignore duplicate plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Oct 2, 2024
1 parent 8ba9571 commit 43f86db
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/gamestarfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ QStringList GameStarfield::primaryPlugins() const
"SFBGS006.esm", "SFBGS007.esm",
"SFBGS008.esm", "BlueprintShips-Starfield.esm"};

plugins << CCCPlugins();
for (auto plugin : CCCPlugins()) {
if (!plugins.contains(plugin, Qt::CaseInsensitive)) {
plugins.append(plugin);
}
}

auto testPlugins = testFilePlugins();
if (loadOrderMechanism() == LoadOrderMechanism::None) {
Expand Down Expand Up @@ -288,13 +292,10 @@ QStringList GameStarfield::CCCPlugins() const
QByteArray line = file->readLine().trimmed();
QString modName;
if ((line.size() > 0) && (line.at(0) != '#')) {
modName = QString::fromUtf8(line.constData()).toLower();
modName = QString::fromUtf8(line.constData());
}

if (modName.size() > 0) {
if (!plugins.contains(modName, Qt::CaseInsensitive)) {
plugins.append(modName);
}
plugins.append(modName);
}
}
}
Expand Down

0 comments on commit 43f86db

Please sign in to comment.