2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 08:23:42 -04:00

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
parent 229e76b87d
commit f9341c8cd3
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)
{