From e768d9ffab874d5991336464c80eb3b9e5a28b0c Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Mon, 12 Dec 2022 08:04:50 +0100 Subject: fix: Make sure all non-core mods get disabled (#103) For this we first rebuild the `enabledmods.json` file. This ensures that all installed mods are actually listed there. The function was originally created before we could rebuild `enabledmods.json` by checking installed mods. --- src-tauri/src/repair_and_verify/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src-tauri') diff --git a/src-tauri/src/repair_and_verify/mod.rs b/src-tauri/src/repair_and_verify/mod.rs index 3d5fdc04..64278a25 100644 --- a/src-tauri/src/repair_and_verify/mod.rs +++ b/src-tauri/src/repair_and_verify/mod.rs @@ -1,4 +1,4 @@ -use crate::{mod_management::set_mod_enabled_status, northstar::CORE_MODS}; +use crate::{mod_management::{set_mod_enabled_status, rebuild_enabled_mods_json}, northstar::CORE_MODS}; use anyhow::anyhow; /// Contains various functions to repair common issues and verifying installation use app::{get_enabled_mods, GameInstall}; @@ -12,6 +12,10 @@ pub fn verify_game_files(game_install: GameInstall) -> Result { /// Disables all mods except core ones /// Enables core mods if disabled pub fn disable_all_but_core(game_install: GameInstall) -> Result<(), String> { + + // Rebuild `enabledmods.json` first to ensure all mods are added + rebuild_enabled_mods_json(game_install.clone())?; + let current_mods = get_enabled_mods(game_install.clone())?; // Disable all mods, set core mods to enabled -- cgit v1.2.3