From c58537e2b8070f271f25ba3adfff90f6e4185d80 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 28 Mar 2026 16:17:59 -0700 Subject: [PATCH] fix: load binary DBCs from Data/db/ fallback path CreatureDisplayInfo.dbc (691KB, 24K+ entries) exists at Data/db/ but the loader only checked DBFilesClient\ (MPQ manifest) and expansion CSV. The CSV had only 13248 entries (malformed export), so TBC+ creatures (Mana Wyrms, Blood Elf area) had no display data and were invisible. Now checks Data/db/ as a fallback for binary DBCs. This path contains pre-extracted DBCs shared across expansions. Binary DBCs have complete record data including proper IDs. --- src/pipeline/asset_manager.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/pipeline/asset_manager.cpp b/src/pipeline/asset_manager.cpp index b357d568..6dc762ac 100644 --- a/src/pipeline/asset_manager.cpp +++ b/src/pipeline/asset_manager.cpp @@ -285,6 +285,28 @@ std::shared_ptr AssetManager::loadDBC(const std::string& name) { dbcData = readFile(dbcPath); } + // Try Data/db/ directory (pre-extracted binary DBCs shared across expansions) + if (dbcData.empty()) { + // dataPath is expansion-specific (e.g. Data/expansions/wotlk/); go up to Data/ + for (const std::string& base : {dataPath + "/db/" + name, + dataPath + "/../../db/" + name, + "Data/db/" + name}) { + if (std::filesystem::exists(base)) { + std::ifstream f(base, std::ios::binary | std::ios::ate); + if (f) { + auto size = f.tellg(); + if (size > 0) { + f.seekg(0); + dbcData.resize(static_cast(size)); + f.read(reinterpret_cast(dbcData.data()), size); + LOG_INFO("Loaded binary DBC from: ", base, " (", size, " bytes)"); + break; + } + } + } + } + } + // Fall back to expansion-specific CSV (e.g. Data/expansions/wotlk/db/Spell.csv) if (dbcData.empty() && !expansionDataPath_.empty()) { std::string baseName = name;