Fix NPC voice and mount sound managers not initializing in online mode

The cachedAssetManager was only set in loadTestTerrain() for single-player mode.
In online mode (loadTerrainArea), it was never set, so NPC voice and mount sound
managers never initialized. Now gets asset manager from Application instance if
not already cached. This will enable file probing and voice/sound loading.
This commit is contained in:
Kelsi 2026-02-09 01:48:19 -08:00
parent ec457a37c8
commit b8375627e9

View file

@ -2168,7 +2168,12 @@ bool Renderer::loadTerrainArea(const std::string& mapName, int centerX, int cent
terrainLoaded = true;
// Initialize music manager with asset manager (if available from loadTestTerrain)
// Get asset manager from Application if not cached yet
if (!cachedAssetManager) {
cachedAssetManager = core::Application::getInstance().getAssetManager();
}
// Initialize music manager with asset manager
if (musicManager && cachedAssetManager) {
if (!musicManager->isInitialized()) {
musicManager->initialize(cachedAssetManager);