From b5ff9eb2a22405bdc6d925170c64aa7fbe50ce29 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 10:45:43 -0700 Subject: [PATCH] feat(runtime): pick up WOM/WOB sidecars from asset tree at load time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit terrain_manager already attempts WOM/WOB via tryLoadByGamePath but its prefix list only included custom_zones/ and output/. The asset extractor's --emit-wom/--emit-wob writes sidecars next to the M2/WMO in the asset tree itself (e.g. /world/maps/foo/foo.wom). Pass the AssetManager's data path as an extra prefix so the runtime picks the open-format sidecar up there before falling back to the proprietary M2/WMO load path. Completes the runtime side of the dual-format extraction: AssetManager::loadTexture → tries .png sidecar first, then BLP. AssetManager::loadDBC → tries .json sidecar first, then DBC. TerrainManager M2/WMO → tries .wom/.wob sidecar first, then m2/wmo. Servers/private servers see no change — they read from the proprietary files via manifest paths and don't touch the sidecars. --- src/rendering/terrain_manager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rendering/terrain_manager.cpp b/src/rendering/terrain_manager.cpp index 84521603..6f9b95c3 100644 --- a/src/rendering/terrain_manager.cpp +++ b/src/rendering/terrain_manager.cpp @@ -490,6 +490,13 @@ std::shared_ptr TerrainManager::prepareTile(int x, int y) { "output/" + mapName + "/models/", "custom_zones/" + mapName + "/models/", }; + // Asset extractor's --emit-wom writes WOM sidecars next to the + // M2 in the asset tree (e.g. /world/maps/foo/foo.wom). + // Add the data path as a prefix so the runtime picks them up + // without needing to copy them into custom_zones/. + if (assetManager && !assetManager->getDataPath().empty()) { + extraPrefixes.push_back(assetManager->getDataPath() + "/"); + } auto wom = pipeline::WoweeModelLoader::tryLoadByGamePath(m2Path, extraPrefixes); if (wom.isValid()) { auto m2Model = pipeline::WoweeModelLoader::toM2(wom); @@ -619,6 +626,12 @@ std::shared_ptr TerrainManager::prepareTile(int x, int y) { "output/" + mapName + "/buildings/", "custom_zones/" + mapName + "/buildings/", }; + // asset_extract --emit-wob writes WOB next to the WMO in + // the asset tree; add the data path so the runtime picks + // them up there too. + if (assetManager && !assetManager->getDataPath().empty()) { + extraPrefixes.push_back(assetManager->getDataPath() + "/"); + } auto wob = pipeline::WoweeBuildingLoader::tryLoadByGamePath( wmoPath, extraPrefixes); if (wob.isValid() &&