소스 검색

Skip unresolved identifier from list of allowed heroes/artifacts in vmap

Ivan Savenko 1 년 전
부모
커밋
1cecaf2bf5
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      lib/serializer/JsonSerializeFormat.cpp

+ 9 - 2
lib/serializer/JsonSerializeFormat.cpp

@@ -135,9 +135,16 @@ void JsonSerializeFormat::readLICPart(const JsonNode & part, const JsonSerialize
 	{
 		const std::string & identifier = index.String();
 
-		const si32 rawId = decoder(identifier);
-		if(rawId != -1)
+		try
+		{
+			const si32 rawId = decoder(identifier);
 			value.insert(rawId);
+		}
+		catch (const IdentifierResolutionException & e)
+		{
+			// downgrade exception to warning (printed as part of exception generation
+			// this is usually caused by loading allowed heroes / artifacts list from vmap's
+		}
 	}
 }