From a01b87aca96af9b302ff11a8d6de2e8a816a91fe Mon Sep 17 00:00:00 2001 From: aleos Date: Fri, 20 Sep 2024 10:12:23 -0400 Subject: [PATCH] Adjust map ID lookup to be primary * Resolves a few cases of where a map may be defined in the index/cache but not enabled from the config. * Comment out a few pre-renewal maps that are not enabled. --- db/pre-re/map_zones.yml | 32 ++++++++++++++++---------------- src/map/map.cpp | 6 ++---- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/db/pre-re/map_zones.yml b/db/pre-re/map_zones.yml index 81441139f9..31f826780a 100644 --- a/db/pre-re/map_zones.yml +++ b/db/pre-re/map_zones.yml @@ -77,9 +77,9 @@ Body: prt_monk: true rachel: true ra_temple: true - thief_1-1: true - thief_2-1: true - thief_3-1: true + #thief_1-1: true + #thief_2-1: true + #thief_3-1: true umbala: true veins: true xmas: true @@ -249,10 +249,10 @@ Body: mjolnir_11: true moc_fild01: true moc_fild02: true - moc_fild05: true - moc_fild06: true + #moc_fild05: true + #moc_fild06: true moc_fild07: true - moc_fild10: true + #moc_fild10: true moc_fild11: true moc_fild12: true moc_fild18: true @@ -416,12 +416,12 @@ Body: mjo_dun02: true mjo_dun03: true moc_fild03: true - moc_fild04: true - moc_fild08: true - moc_fild09: true + #moc_fild04: true + #moc_fild08: true + #moc_fild09: true moc_fild13: true - moc_fild14: true - moc_fild15: true + #moc_fild14: true + #moc_fild15: true moc_fild16: true moc_fild17: true moc_fild19: true @@ -566,13 +566,13 @@ Body: n_castle: true ordeal_1-1: true ordeal_1-2: true - ordeal_1-3: true + #ordeal_1-3: true ordeal_2-1: true ordeal_2-2: true - ordeal_2-3: true + #ordeal_2-3: true ordeal_3-1: true ordeal_3-2: true - ordeal_3-3: true + #ordeal_3-3: true poring_w01: true #priest_1-1: true #priest_2-1: true @@ -1170,8 +1170,8 @@ Body: - Id: MonsterTrack # Boss area Maps: - poring_c01: true - poring_c02: true + #poring_c01: true + #poring_c02: true thana_boss: true Mapflags: - Flag: NoMemo diff --git a/src/map/map.cpp b/src/map/map.cpp index c875d11eae..c1def3a225 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -427,9 +427,9 @@ uint64 MapZoneDatabase::parseBodyNode(const ryml::NodeRef& node) { for (const auto &it : mapNode) { std::string map_name; c4::from_chars(it.key(), &map_name); - int16 mapidx = mapindex_name2idx(map_name.c_str(), nullptr); + int16 map_id = map_mapname2mapid(map_name.c_str()); - if (mapidx == 0) { + if (map_id < 0) { this->invalidWarning(mapNode, "Map %s does not exist.\n", map_name.c_str()); continue; } @@ -439,8 +439,6 @@ uint64 MapZoneDatabase::parseBodyNode(const ryml::NodeRef& node) { if (!this->asBool(mapNode, map_name, enabled)) continue; - int16 map_id = map_mapname2mapid(map_name.c_str()); - if (enabled) { if (util::vector_exists(zone->maps, map_id)) { this->invalidWarning(mapNode, "Map %s is already part of this zone.\n", map_name.c_str());