Skip to content

Commit

Permalink
Don't support "Data" as a source location for fomods
Browse files Browse the repository at this point in the history
Fomods that pull files from <fomod_folder>/Data aren't supported since
we have to delete the Data folder when we reconfigure them. Produce a
useful error when this happens to indicate manual intervention is
required.

So far, this impacts new versions of MCM Helper. There might or might
not be others.
  • Loading branch information
cyberrumor committed Mar 8, 2024
1 parent 1e37c2a commit 9a8134a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ammo/fomod_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,13 @@ def _install_files(self, selected_nodes: list) -> None:
full_source = self.mod.location
for i in s.split("\\"):
folder = i
assert (
# If a fomod has a Data folder in its normal structure and uses
# it as file sources, it will break the second time you configure it.
# This isn't supported. Just advise people to reinstall the mod.
full_source.exists()
), "This fomod uses Data as a source folder (unsupported). Reinstall then configure manually."

for file in os.listdir(full_source):
if file.lower() == i.lower():
folder = file
Expand Down

0 comments on commit 9a8134a

Please sign in to comment.