@@ -253,45 +253,36 @@ static func _update_mod_list(mod_list: Dictionary, mod_data := ModLoaderStore.mo
253
253
var updated_mod_list := mod_list .duplicate (true )
254
254
255
255
# Iterate over each mod ID in the mod list
256
- for mod_id in updated_mod_list :
256
+ for mod_id in updated_mod_list . keys () :
257
257
var mod_list_entry : Dictionary = updated_mod_list [mod_id ]
258
258
259
- # If mod data is accessible and the mod is not loaded
260
- if not mod_data .empty () and not mod_data .has (mod_id ):
261
- # Check if the mod_dir for the mod-id exists
262
- if not _ModLoaderFile .dir_exists (_ModLoaderPath .get_unpacked_mods_dir_path () + mod_id ):
263
- # If the mod directory doesn't exist,
264
- # the mod is no longer installed and can be removed from the mod list
265
- updated_mod_list .erase (mod_id )
266
- continue
267
-
268
259
# Check if the current config doesn't exist
269
260
# This can happen if the config file was manually deleted
270
261
if mod_list_entry .has ("current_config" ) and _ModLoaderPath .get_path_to_mod_config_file (mod_id , mod_list_entry .current_config ).empty ():
271
262
# If the current config doesn't exist, reset it to the default configuration
272
263
mod_list_entry .current_config = ModLoaderConfig .DEFAULT_CONFIG_NAME
273
264
274
- # If the mod is not loaded
275
- if not mod_data . has ( mod_id ):
276
- if (
277
- # Check if the entry has a zip_path key
278
- mod_list_entry .has ("zip_path" ) and
279
- # Check if the entry has a zip_path
280
- not mod_list_entry .zip_path .empty () and
281
- # Check if the zip file for the mod exists
282
- not _ModLoaderFile .file_exists (mod_list_entry .zip_path )
283
- ):
284
- # If the mod directory doesn't exist,
285
- # the mod is no longer installed and can be removed from the mod list
286
- ModLoaderLog .debug (
287
- "Mod \" %s \" has been deleted from all user profiles as the corresponding zip file no longer exists at path \" %s \" ."
288
- % [mod_id , mod_list_entry .zip_path ],
289
- LOG_NAME ,
290
- true
291
- )
292
-
293
- updated_mod_list .erase (mod_id )
294
- continue
265
+ if (
266
+ # If the mod is not loaded
267
+ not mod_data . has ( mod_id ) and
268
+ # Check if the entry has a zip_path key
269
+ mod_list_entry .has ("zip_path" ) and
270
+ # Check if the entry has a zip_path
271
+ not mod_list_entry .zip_path .empty () and
272
+ # Check if the zip file for the mod doesn't exist
273
+ not _ModLoaderFile .file_exists (mod_list_entry .zip_path )
274
+ ):
275
+ # If the mod directory doesn't exist,
276
+ # the mod is no longer installed and can be removed from the mod list
277
+ ModLoaderLog .debug (
278
+ "Mod \" %s \" has been deleted from all user profiles as the corresponding zip file no longer exists at path \" %s \" ."
279
+ % [mod_id , mod_list_entry .zip_path ],
280
+ LOG_NAME ,
281
+ true
282
+ )
283
+
284
+ updated_mod_list .erase (mod_id )
285
+ continue
295
286
296
287
updated_mod_list [mod_id ] = mod_list_entry
297
288
0 commit comments