Changing Loadmap, to just lookup by ID as this is supported by Blizzard-database-lib

This commit is contained in:
Alister
2021-12-24 11:16:47 +00:00
parent 1f242b5cf5
commit b76889dc91

View File

@@ -198,19 +198,10 @@ namespace Noggit::Ui
auto table = _project->ClientDatabase->LoadTable("Map");
auto record = table.Record(mapID);
for (DBCFile::Iterator it = gMapDB.begin(); it != gMapDB.end(); ++it)
{
if (it->getInt(MapDB::MapID) == mapID)
{
_world = std::make_unique<World> (it->getString(MapDB::InternalName), mapID, Noggit::NoggitRenderContext::MAP_VIEW);
_minimap->world (_world.get());
emit map_selected(mapID);
_world = std::make_unique<World>(record.Columns["Directory"].Value, mapID, Noggit::NoggitRenderContext::MAP_VIEW);
_minimap->world(_world.get());
emit map_selected(mapID);
return;
}
}
LogError << "Map with ID " << mapID << " not found. Failed loading." << std::endl;
}
void main_window::build_menu()