Skip to content

Commit

Permalink
fix all versions check
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Sep 11, 2024
1 parent 30dc70c commit 818d8bf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions loader/src/ui/mods/list/ModItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 <cr>unsupported version of Geode</c>.",
"Invalid Platform",
"This mod is <cr>not available</c> 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 <cr>not available</c> for your current platform.",
"Unavailable",
"This mod targets an <cr>unsupported version of Geometry Dash</c>.",
"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 <cr>different version of Geometry Dash</c>. "
"<co>Please wait for its developer to update it.</c>",
"Unavailable",
"This mod targets an <cr>unsupported version of Geode</c>.",
"OK", nullptr, 360
)->show();
}
Expand Down

0 comments on commit 818d8bf

Please sign in to comment.