瀏覽代碼

Fix crash on accessing "any" spellschool via bonus system

Ivan Savenko 2 年之前
父節點
當前提交
77780e0de5
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/constants/EntityIdentifiers.cpp

+ 3 - 0
lib/constants/EntityIdentifiers.cpp

@@ -420,6 +420,9 @@ si32 SpellSchool::decode(const std::string & identifier)
 
 std::string SpellSchool::encode(const si32 index)
 {
+	if (index == ANY.getNum())
+		return "any";
+
 	return SpellConfig::SCHOOL[index].jsonName;
 }