From 252d009283c09776937fb824d8f0c1d45766642c Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 16 Mar 2024 19:18:25 +0000 Subject: [PATCH] Prevent outdated mods from loading --- project/src/loaders/PreAkiModLoader.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/project/src/loaders/PreAkiModLoader.ts b/project/src/loaders/PreAkiModLoader.ts index 420f5ba2..784aa6f0 100644 --- a/project/src/loaders/PreAkiModLoader.ts +++ b/project/src/loaders/PreAkiModLoader.ts @@ -338,6 +338,7 @@ export class PreAkiModLoader implements IModLoader if (!mod.akiVersion) { this.logger.error(this.localisationService.getText("modloader-missing_akiversion_field", modName)); + return false; } @@ -345,14 +346,16 @@ export class PreAkiModLoader implements IModLoader if (!(semver.valid(mod.akiVersion) || semver.validRange(mod.akiVersion))) { this.logger.error(this.localisationService.getText("modloader-invalid_akiversion_field", modName)); + return false; } - // Warn and allow loading if semver is not satisfied + // Error and prevent loading if semver is not satisfied if (!semver.satisfies(akiVersion, mod.akiVersion)) { - this.logger.warning(this.localisationService.getText("modloader-outdated_akiversion_field", modName)); - return true; + this.logger.error(this.localisationService.getText("modloader-outdated_akiversion_field", modName)); + + return false; } return true;