mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-16 09:13:50 +00:00
fix(ui): use display name from Map.dbc field 4 instead of internal name
Was reading field 2 (InstanceType) which fell back to field 1 (internal
name like "Azeroth"). Field 4 has the localized display name ("Eastern
Kingdoms").
This commit is contained in:
parent
535ae8aa89
commit
e4c4b6f429
1 changed files with 4 additions and 3 deletions
|
|
@ -7091,11 +7091,12 @@ void GameHandler::loadMapNameCache() const {
|
|||
auto dbc = am->loadDBC("Map.dbc");
|
||||
if (!dbc || !dbc->isLoaded()) return;
|
||||
|
||||
// Map.dbc layout: 0=ID, 1=InternalName, 2=InstanceType, 3=Flags,
|
||||
// 4=MapName_enUS (display name), fields 5+ = other locales
|
||||
for (uint32_t i = 0; i < dbc->getRecordCount(); ++i) {
|
||||
uint32_t id = dbc->getUInt32(i, 0);
|
||||
// Field 2 = MapName_enUS (first localized); field 1 = InternalName fallback
|
||||
std::string name = dbc->getString(i, 2);
|
||||
if (name.empty()) name = dbc->getString(i, 1);
|
||||
std::string name = dbc->getString(i, 4);
|
||||
if (name.empty()) name = dbc->getString(i, 1); // internal name fallback
|
||||
if (!name.empty() && !mapNameCache_.count(id)) {
|
||||
mapNameCache_[id] = std::move(name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue