From e6aa4a7433c19f47b32728648c68006dc592a07e Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 13 Sep 2025 00:15:48 -0400 Subject: [PATCH] Over corrected and broke music. --- src/level.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/level.py b/src/level.py index 20c173a..f30474c 100644 --- a/src/level.py +++ b/src/level.py @@ -58,11 +58,18 @@ class Level: ambientFile = levelData["ambience"] # Build list of paths to try (pack-specific first, then generic) + # Include both PyInstaller-aware absolute paths and relative paths for compatibility ambiencePaths = [] soundsDir = get_sounds_directory_path() if self.levelPackName: + # PyInstaller-aware absolute path ambiencePaths.append(os.path.join(soundsDir, self.levelPackName, "ambience", ambientFile)) + # Original relative path (for compatibility) + ambiencePaths.append(f"sounds/{self.levelPackName}/ambience/{ambientFile}") + # PyInstaller-aware absolute path ambiencePaths.append(os.path.join(soundsDir, "ambience", ambientFile)) + # Original relative path (for compatibility) + ambiencePaths.append(f"sounds/ambience/{ambientFile}") # Try each path until one works for ambiencePath in ambiencePaths: