Over corrected and broke music.

This commit is contained in:
Storm Dragon
2025-09-13 00:15:48 -04:00
parent f37edcd28b
commit e6aa4a7433

View File

@@ -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: