File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
addons/mod_loader/resources Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,12 @@ func load_configs() -> void:
88
88
_load_config (config_file_path )
89
89
90
90
# Set the current_config based on the user profile
91
- current_config = ModLoaderConfig .get_current_config (dir_name )
91
+ var current_config_user_profile = ModLoaderConfig .get_current_config (dir_name )
92
+
93
+ # If we cannot get the current_config from the user profile, set the config to default.
94
+ # This should only happen on the first run because the user profile is generated in _ready(), or if the
95
+ # user profile JSON file was deleted manually.
96
+ current_config = current_config_user_profile if current_config_user_profile else ModLoaderConfig .get_default_config (dir_name )
92
97
93
98
94
99
# Create a new ModConfig instance for each Config JSON and add it to the configs dictionary.
@@ -104,10 +109,6 @@ func _load_config(config_file_path: String) -> void:
104
109
# Add the config to the configs dictionary
105
110
configs [mod_config .name ] = mod_config
106
111
107
- # Set it as the current_config if there is none
108
- if not current_config :
109
- current_config = mod_config
110
-
111
112
112
113
# Update the mod_list of the current user profile
113
114
func _set_current_config (new_current_config : ModConfig ) -> void :
You can’t perform that action at this time.
0 commit comments