Skip to content

Commit cae15af

Browse files
[Baldur's Gate 3]: Various bug fixes (#193)
* Add additional DLLs to the lslib retriever * Fix regex pattern for folder name in pak_parser * Ensure log directory is created if missing * Update pak file naming to include parent directory name
1 parent d29425c commit cae15af

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

games/baldursgate3/lslib_retriever.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ def _needed_lslib_files(self):
2525
"Divine.dll.config",
2626
"Divine.exe",
2727
"Divine.runtimeconfig.json",
28+
"K4os.Compression.LZ4.dll",
29+
"K4os.Compression.LZ4.Streams.dll",
2830
"LSLib.dll",
2931
"LSLibNative.dll",
3032
"LZ4.dll",
33+
"Newtonsoft.Json.dll",
3134
"System.IO.Hashing.dll",
3235
"ZstdSharp.dll",
3336
}

games/baldursgate3/pak_parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ def _get_metadata_for_file(
154154
f"pak with same name as packable dir exists in mod directory. not packing dir {file}"
155155
)
156156
return ""
157-
pak_path = self._utils.overwrite_path / f"Mods/{file.name}.pak"
157+
parent_mod_name = file.parent.name.replace(" ", "_")
158+
pak_path = (
159+
self._utils.overwrite_path
160+
/ f"Mods/{parent_mod_name}_{file.name}.pak"
161+
)
158162
build_pak = True
159163
if pak_path.exists():
160164
pak_creation_time = os.path.getmtime(pak_path)
@@ -249,7 +253,7 @@ def metadata_to_ini(
249253
# 2. it has files in Mods/<folder_name>/ other than the meta.lsx file, or
250254
# 3. it has files in Public/<folder_name>
251255
result = self.run_divine(
252-
f'list-package --use-regex -x "(/{folder_name}/(?!meta\\.lsx))|(Public/Engine/Timeline/MaterialGroups)"',
256+
f'list-package --use-regex -x "(/{re.escape(folder_name)}/(?!meta\\.lsx))|(Public/Engine/Timeline/MaterialGroups)"',
253257
file,
254258
)
255259
self._mod_cache[file] = (

games/game_baldursgate3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def _base_dlls(self) -> set[str]:
179179
def _on_finished_run(self, exec_path: str, exit_code: int):
180180
if "bin/bg3" not in exec_path:
181181
return
182+
self.utils.log_dir.mkdir(parents=True, exist_ok=True)
182183
if self.utils.log_diff:
183184
for x in difflib.unified_diff(
184185
open(self.utils.modsettings_backup).readlines(),

0 commit comments

Comments
 (0)