diff --git a/src/pipeline/asset_manager.cpp b/src/pipeline/asset_manager.cpp index 8429bb5b..2bff1972 100644 --- a/src/pipeline/asset_manager.cpp +++ b/src/pipeline/asset_manager.cpp @@ -311,6 +311,27 @@ std::shared_ptr AssetManager::loadDBC(const std::string& name) { } } + // Check for JSON DBC from custom zones (wowee open format) + // JSON DBCs exported by the editor contain the same record data + // but the DBCFile::load() only handles binary — so JSON overrides + // are logged for now and will need a JSON→DBC converter in future. + if (dbcData.empty()) { + std::string baseName = name; + auto dot = baseName.rfind('.'); + if (dot != std::string::npos) baseName = baseName.substr(0, dot); + for (const std::string& dir : {"custom_zones", "output"}) { + if (!std::filesystem::exists(dir)) continue; + for (auto& entry : std::filesystem::directory_iterator(dir)) { + if (!entry.is_directory()) continue; + std::string jsonPath = entry.path().string() + "/data/" + baseName + ".json"; + if (std::filesystem::exists(jsonPath)) { + LOG_DEBUG("JSON DBC available (not yet loaded): ", jsonPath); + break; + } + } + } + } + // Fall back to expansion-specific CSV (e.g. Data/expansions/wotlk/db/Spell.csv) if (dbcData.empty() && !expansionDataPath_.empty()) { std::string baseName = name; diff --git a/src/rendering/terrain_manager.cpp b/src/rendering/terrain_manager.cpp index 460f67af..af2db97f 100644 --- a/src/rendering/terrain_manager.cpp +++ b/src/rendering/terrain_manager.cpp @@ -10,6 +10,7 @@ #include "core/coordinates.hpp" #include "pipeline/wowee_terrain_loader.hpp" #include "pipeline/wowee_model.hpp" +#include "pipeline/wowee_building.hpp" #include "core/memory_monitor.hpp" #include "core/profiler.hpp" #include "pipeline/asset_manager.hpp" @@ -594,6 +595,22 @@ std::shared_ptr TerrainManager::prepareTile(int x, int y) { if (placement.nameId >= pending->terrain.wmoNames.size()) continue; const std::string& wmoPath = pending->terrain.wmoNames[placement.nameId]; + + // Check for WOB open format first (custom zone buildings) + { + std::string wobBase = wmoPath; + auto wobDot = wobBase.rfind('.'); + if (wobDot != std::string::npos) wobBase = wobBase.substr(0, wobDot); + std::replace(wobBase.begin(), wobBase.end(), '\\', '/'); + std::vector wobPrefixes = {"custom_zones/buildings/", "output/" + mapName + "/buildings/"}; + for (const auto& prefix : wobPrefixes) { + if (pipeline::WoweeBuildingLoader::exists(prefix + wobBase)) { + LOG_INFO("WOB building found: ", prefix + wobBase, " (loading not yet implemented)"); + break; + } + } + } + std::vector wmoData = assetManager->readFile(wmoPath); if (wmoData.empty()) continue;