Переглянути джерело

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.

aleos 8 місяців тому
батько
коміт
a01b87aca9
2 змінених файлів з 18 додано та 20 видалено
  1. 16 16
      db/pre-re/map_zones.yml
  2. 2 4
      src/map/map.cpp

+ 16 - 16
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

+ 2 - 4
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());