summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2018-05-02 12:38:23 -0500
committerSilarn <jrim@rimpo.org>2018-05-02 12:38:23 -0500
commit168da18aa51868ad3ac908affb55a8aabdba1aed (patch)
tree7ebd21b8936f27b620a6eab72a4eeb19789bed20 /src/mainwindow.cpp
parentd62ec9c867b448276ab9873ddd3f320487ab5572 (diff)
Fix MO endorsement check and add game to ModInfo s_ModsByModID
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 3933987e..a95b7b70 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -4231,12 +4231,20 @@ void MainWindow::nxmUpdatesAvailable(const std::vector<int> &modIDs, QVariant us
QVariantList resultList = resultData.toList();
for (auto iter = resultList.begin(); iter != resultList.end(); ++iter) {
QVariantMap result = iter->toMap();
- if (result["id"].toInt() == m_OrganizerCore.managedGame()->nexusModOrganizerID()) {
+ if (result["id"].toInt() == m_OrganizerCore.managedGame()->nexusModOrganizerID()
+ && result["game_id"].toInt() == m_OrganizerCore.managedGame()->nexusGameID()) {
if (!result["voted_by_user"].toBool()) {
ui->actionEndorseMO->setVisible(true);
}
} else {
- std::vector<ModInfo::Ptr> info = ModInfo::getByModID(result["id"].toInt());
+ QString gameName = m_OrganizerCore.managedGame()->gameShortName();
+ for (IPluginGame *game : m_PluginContainer.plugins<IPluginGame>()) {
+ if (game->nexusGameID() == result["game_id"].toInt()) {
+ gameName = game->gameShortName();
+ break;
+ }
+ }
+ std::vector<ModInfo::Ptr> info = ModInfo::getByModID(gameName, result["id"].toInt());
for (auto iter = info.begin(); iter != info.end(); ++iter) {
(*iter)->setNewestVersion(result["version"].toString());
(*iter)->setNexusDescription(result["description"].toString());