feat(runtime): pick up WHM/WOT/WOC sidecars from asset tree

Closes the loop on the asset_extract --emit-terrain pipeline. The
runtime terrain loader now probes for a .whm/.wot/.woc trio in the
same directory as the resolved ADT (e.g. <data>/world/maps/foo/
foo_30_30.{whm,wot,woc}) before falling back to ADTLoader.

Hits the open-format path when:
  custom_zones/<map>/<map>_X_Y.{whm,wot} exists  (zone author override)
  output/<map>/<map>_X_Y.{whm,wot} exists        (editor export)
  <data>/world/maps/<map>/<map>_X_Y.{whm,wot}    (asset extractor)
  -- otherwise falls through to ADTLoader::load(adtData)

Promotes AssetManager::resolveFile to public so callers (terrain
sidecar probe here, anything else later) can locate an extracted
file's directory without reading the bytes.

Servers/private servers continue to read .adt via manifest paths
unchanged. Runtime sidecar coverage now matches the extractor's
emit set across all five binary open formats.
This commit is contained in:
Kelsi 2026-05-06 10:48:40 -07:00
parent b5ff9eb2a2
commit ea745005ce
2 changed files with 42 additions and 5 deletions

View file

@ -147,6 +147,16 @@ public:
*/
size_t purgeExtractedAssets();
/**
* Resolve a normalized WoW path to its on-disk location. Checks the
* override directory first, then the manifest, then the base-fallback
* manifest. Public so callers (e.g. terrain_manager probing for
* sidecar files like .whm/.wot/.woc next to a .adt) can locate the
* extracted file's directory without reading it.
* @return absolute or relative fs path, or "" if not found
*/
std::string resolveFile(const std::string& normalizedPath) const;
private:
bool initialized = false;
std::string dataPath;
@ -162,11 +172,7 @@ private:
std::string baseFallbackDataPath_;
AssetManifest baseFallbackManifest_;
/**
* Resolve filesystem path: check override dir first, then base manifest.
* Returns empty string if not found.
*/
std::string resolveFile(const std::string& normalizedPath) const;
// (resolveFile moved to public — declaration above.)
// Guards fileCache, dbcCache, fileCacheTotalBytes, fileCacheAccessCounter, and
// fileCacheBudget. Shared lock for read-only cache lookups (readFile cache hit,