From 831fdcefc94c4034452ce5446f15c1837c294ee8 Mon Sep 17 00:00:00 2001 From: Isaac0-dev <62234577+Isaac0-dev@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:39:38 +1000 Subject: [PATCH] fix linked lists in mod enabled list --- src/pc/mods/mods.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pc/mods/mods.c b/src/pc/mods/mods.c index 2485661c0..32a5830b3 100644 --- a/src/pc/mods/mods.c +++ b/src/pc/mods/mods.c @@ -6,6 +6,7 @@ #include "pc/debuglog.h" #include "pc/loading.h" #include "pc/fs/fmem.h" +#include "pc/pc_main.h" #if defined(_WIN32) || defined(_WIN64) #include @@ -94,6 +95,7 @@ static void mods_local_store_enabled(void) { } else { prev->next = n; } + prev = n; } } @@ -280,7 +282,7 @@ static void mods_load(struct Mods* mods, char* modsBasePath, UNUSED bool isUserM void mods_refresh_local(void) { LOADING_SCREEN_MUTEX(loading_screen_set_segment_text("Refreshing Mod Cache")); - mods_local_store_enabled(); + if (gGameInited) { mods_local_store_enabled(); } // figure out user path bool hasUserPath = true; @@ -312,7 +314,7 @@ void mods_refresh_local(void) { gLocalMods.size += mod->size; } - mods_local_restore_enabled(); + if (gGameInited) { mods_local_restore_enabled(); } } void mods_enable(char* relativePath) {