From 818d8bfe288e8f244b0fe51d02d8324805f53b61 Mon Sep 17 00:00:00 2001 From: Chloe <25387744+qimiko@users.noreply.github.com> Date: Wed, 11 Sep 2024 01:01:20 -0700 Subject: [PATCH] fix all versions check --- loader/src/ui/mods/list/ModItem.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/loader/src/ui/mods/list/ModItem.cpp b/loader/src/ui/mods/list/ModItem.cpp index 4c3b89428..2d4835e34 100644 --- a/loader/src/ui/mods/list/ModItem.cpp +++ b/loader/src/ui/mods/list/ModItem.cpp @@ -140,7 +140,7 @@ bool ModItem::init(ModSource&& source) { auto geodeValid = Loader::get()->isModVersionSupported(version.getGeodeVersion()); auto gameVersion = version.getGameVersion(); - auto gdValid = gameVersion == "*" || gameVersion == GEODE_STR(GEODE_GD_VERSION); + auto gdValid = !gameVersion || gameVersion == "*" || gameVersion == GEODE_STR(GEODE_GD_VERSION); if (!geodeValid || !gdValid) { spr = createGeodeButton("N/A", 50, false, true, GeodeButtonSprite::Gray); @@ -496,28 +496,28 @@ void ModItem::onView(CCObject*) { // Show popups for invalid mods if (m_source.asServer()) { auto version = m_source.asServer()->latestVersion(); - if (!Loader::get()->isModVersionSupported(version.getGeodeVersion())) { + auto gameVersion = version.getGameVersion(); + if (gameVersion == "0.000") { return FLAlertLayer::create( nullptr, - "Unavailable", - "This mod targets an unsupported version of Geode.", + "Invalid Platform", + "This mod is not available for your current platform.", "OK", nullptr, 360 )->show(); } - if (version.getGameVersion() == "0.000") { + if (gameVersion && gameVersion != "*" && gameVersion != GEODE_STR(GEODE_GD_VERSION)) { return FLAlertLayer::create( nullptr, - "Invalid Platform", - "This mod is not available for your current platform.", + "Unavailable", + "This mod targets an unsupported version of Geometry Dash.", "OK", nullptr, 360 )->show(); } - if (version.getGameVersion() != "*" && version.getGameVersion() != GEODE_STR(GEODE_GD_VERSION)) { + if (!Loader::get()->isModVersionSupported(version.getGeodeVersion())) { return FLAlertLayer::create( nullptr, - "Outdated", - "This mod targets a different version of Geometry Dash. " - "Please wait for its developer to update it.", + "Unavailable", + "This mod targets an unsupported version of Geode.", "OK", nullptr, 360 )->show(); }