Skip to content

Commit

Permalink
Fix collisions command sometimes not working
Browse files Browse the repository at this point in the history
The collisions command wasn't normalizing the capitalization on the data
directory. Ensure it does this so conflicting files can be shown
relative to the game directory.
  • Loading branch information
cyberrumor committed Oct 1, 2024
1 parent 15e9ed7 commit 88dd007
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ammo/mod_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ def collisions(self, index: int) -> None:
if not subject.conflict:
raise Warning("No conflicts.")

def get_relative_files(mod):
def get_relative_files(mod: Mod):
# Iterate through the source files of the mod
for src in mod.files:
# Get the sanitized full path relative to the game.directory.
if mod.fomod:
Expand All @@ -1056,9 +1057,11 @@ def get_relative_files(mod):
else:
corrected_name = str(src).split(mod.name, 1)[-1].strip("/")

if mod.install_dir.name == mod.game_data.name:
corrected_name = mod.game_data.name + f"/{corrected_name}"
yield corrected_name
dest = mod.install_dir / corrected_name
dest = normalize(dest, self.game.directory)
dest = str(dest).split(str(self.game.directory), 1)[-1].strip("/")

yield dest

enabled_mods = [i for i in self.mods if i.enabled and i.conflict]
enabled_mod_names = [i.name for i in enabled_mods]
Expand Down

0 comments on commit 88dd007

Please sign in to comment.