feat(runtime): pick up WOM/WOB sidecars from asset tree at load time

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. <data>/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.
This commit is contained in:
Kelsi 2026-05-06 10:45:43 -07:00
parent 1995ed9824
commit b5ff9eb2a2

View file

@ -490,6 +490,13 @@ std::shared_ptr<PendingTile> 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. <data>/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<PendingTile> 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() &&