瀏覽代碼

Fixed some errors in yaml2sql (#8875)

Fixes #8867

Thanks to @Miraakol and @datawulf
Lemongrass3110 5 月之前
父節點
當前提交
84b4832abb
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 4 0
      doc/yaml/sql/mob_db_re.sql
  2. 7 1
      src/tool/yaml2sql.cpp

+ 4 - 0
doc/yaml/sql/mob_db_re.sql

@@ -65,6 +65,10 @@ CREATE TABLE `mob_db_re` (
   `racegroup_illusion_turtle` tinyint(1) unsigned DEFAULT NULL,
   `racegroup_rachel_sanctuary` tinyint(1) unsigned DEFAULT NULL,
   `racegroup_illusion_luanda` tinyint(1) unsigned DEFAULT NULL,
+  `racegroup_illusion_frozen` tinyint(1) unsigned DEFAULT NULL,
+  `racegroup_illusion_moonlight` tinyint(1) unsigned DEFAULT NULL,
+  `racegroup_ep16_def` tinyint(1) unsigned DEFAULT NULL,
+  `racegroup_edda_arunafeltz` tinyint(1) unsigned DEFAULT NULL,
   `element` varchar(24) DEFAULT NULL,
   `element_level` tinyint(4) unsigned DEFAULT NULL,
   `walk_speed` smallint(6) unsigned DEFAULT NULL,

+ 7 - 1
src/tool/yaml2sql.cpp

@@ -816,7 +816,13 @@ static bool mob_db_yaml2sql(const std::string &file, const std::string &table) {
 
 		if (racegroups) {
 			for (uint16 i = 1; i < RC2_MAX; i++) {
-				std::string constant = constant_lookup(i, "RC2_");
+				const char* constant_ptr = constant_lookup(i, "RC2_");
+
+				if( constant_ptr == nullptr ){
+					continue;
+				}
+
+				std::string constant( constant_ptr );
 
 				constant.erase(0, 4);