Skip to content

Commit

Permalink
Merge pull request #37 from TheEnderek0/dev/game_mounting
Browse files Browse the repository at this point in the history
Fix issues with mounting mounts.kv
  • Loading branch information
TeamSpen210 authored Nov 17, 2024
2 parents fea5e5a + f4ffb0b commit ec76455
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Version (dev)
* Avoid escaping `/` and `?`, these are unambiguous.
* Add :py:attr:`ValueTypes.EXT_SOUNDSCAPE <srctools.fgd.ValueTypes.EXT_SOUNDSCAPE>`.
* Support exporting FGDs with unevaulated string bases.
* Fix some options being incorrectly handled in Strata game mounts definitions.

-------------
Version 2.4.1
Expand Down
10 changes: 8 additions & 2 deletions src/srctools/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def vpk_patch(p: Path) -> Path:
required = mount.bool("required", False)
# Selects if we want to mount the "mod_folder" key as a folder or omit
mountmoddir = mount.bool("mountmoddir", True)
if not mount.bool("enabled", True): # Undocumented keyval
continue

try:
app_info = find_app(appid)
Expand All @@ -145,8 +147,12 @@ def vpk_patch(p: Path) -> Path:
continue

for child in mount:
if child.name in ("head", "required", "mountmoddir"):
continue # Ignore
# Ignore specified keys above
if child.name in ("head", "required", "enabled", "mountmoddir"):
continue
# Ignore any other leaf KVs.
if not child.has_children():
continue

# Else we're working with a mod folder
this_path = app_info.path / child.real_name
Expand Down

0 comments on commit ec76455

Please sign in to comment.