Sfoglia il codice sorgente

vcmi: make "noneOf" selector more restrictive

It should do "or-not" instead of "and-not".
Konstantin P 2 anni fa
parent
commit
1522ed85e2
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      lib/JsonNode.cpp

+ 2 - 2
lib/JsonNode.cpp

@@ -1058,9 +1058,9 @@ CSelector JsonUtils::parseSelector(const JsonNode & ability)
 	value = &ability["noneOf"];
 	value = &ability["noneOf"];
 	if(value->isVector())
 	if(value->isVector())
 	{
 	{
-		CSelector base = Selector::all;
+		CSelector base = Selector::none;
 		for(const auto & andN : value->Vector())
 		for(const auto & andN : value->Vector())
-			base.And(parseSelector(andN));
+			base.Or(parseSelector(andN));
 		
 		
 		ret = ret.And(base.Not());
 		ret = ret.And(base.Not());
 	}
 	}