mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
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.
This commit is contained in:
parent
d8c768701d
commit
c58537e2b8
1 changed files with 22 additions and 0 deletions
|
|
@ -285,6 +285,28 @@ std::shared_ptr<DBCFile> 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_t>(size));
|
||||
f.read(reinterpret_cast<char*>(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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue