Skip to content

Commit

Permalink
Fixed issue where patcher would try to install mods if none were dete…
Browse files Browse the repository at this point in the history
…cted instead of exiting
  • Loading branch information
theflyingzamboni committed Nov 14, 2021
1 parent c75e0ab commit c2964a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lodmods.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,9 @@ def parse_arguments():
list_file = config_dict['[File Lists]'][args.version]

try:
update_mod_list(args.config_file, config_dict, swap)
mods_found = update_mod_list(args.config_file, config_dict, swap)
if not mods_found:
sys.exit()

disc_dict_pair = []
for version in [s for s in swap if s is not None]:
Expand Down
13 changes: 11 additions & 2 deletions mod_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ def update_mod_list(config_file, config_dict, version_list):
Config dict object read from config file.
version_list : str list
List of game versions in config file (currently only USA and JPN).
Returns
-------
bool
Returns whether mods were found.
"""

config_dict['[Mod List]'] = {}
Expand All @@ -53,7 +58,7 @@ def update_mod_list(config_file, config_dict, version_list):
if not config_dict['[Mod List]']:
print('LODMods: No mods found. Make sure to unzip '
'all mods and move them to the "mods" folder.')
return
return False

available_mods = list(config_dict['[Mod List]'].keys())
swap_required = []
Expand Down Expand Up @@ -99,6 +104,8 @@ def update_mod_list(config_file, config_dict, version_list):

update_config(config_file, config_dict)

return True


def create_patches(list_file, game_files_dir, patch_dir, disc_dict):
"""
Expand Down Expand Up @@ -389,7 +396,9 @@ def main():
list_file = config_dict['[File Lists]'][version]
game_files_dir = config_dict['[Modding Directories]']['Game Files']

update_mod_list('lodmods.config', config_dict, swap)
mods_found = update_mod_list('lodmods.config', config_dict, swap)
if not mods_found:
return

disc_dict_pair = []
for version in [s for s in swap if s is not None]:
Expand Down

0 comments on commit c2964a1

Please sign in to comment.