Allow omit of explicit true in complex criteria (#101)

This commit is contained in:
Jonathan Miller 2022-12-21 10:02:06 -03:30 committed by GitHub
commit f9341c8cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -315,10 +315,14 @@ namespace Observatory.Explorer
try
{
var result = criteriaFunction.Value.Call(scan, parents, scanList, bioSignals, geoSignals);
if (result.Length > 0 && ((bool?)result[0]).GetValueOrDefault(false))
if (result.Length == 3 && ((bool?)result[0]).GetValueOrDefault(false))
{
results.Add((result[1].ToString(), result[2].ToString(), false));
}
else if (result.Length == 2)
{
results.Add((result[0].ToString(), result[1].ToString(), false));
}
}
catch (NLua.Exceptions.LuaScriptException e)
{