From f9341c8cd33e1f7eed3016c7384b901bbdecc8e7 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Wed, 21 Dec 2022 10:02:06 -0330 Subject: [PATCH] Allow omit of explicit `true` in complex criteria (#101) --- ObservatoryExplorer/CustomCriteriaManager.cs | 6 +++++- ObservatoryHerald/ObservatoryAPI.Designer.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ObservatoryExplorer/CustomCriteriaManager.cs b/ObservatoryExplorer/CustomCriteriaManager.cs index d40900d..85d3583 100644 --- a/ObservatoryExplorer/CustomCriteriaManager.cs +++ b/ObservatoryExplorer/CustomCriteriaManager.cs @@ -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) { diff --git a/ObservatoryHerald/ObservatoryAPI.Designer.cs b/ObservatoryHerald/ObservatoryAPI.Designer.cs index 4081ed0..0e998c9 100644 --- a/ObservatoryHerald/ObservatoryAPI.Designer.cs +++ b/ObservatoryHerald/ObservatoryAPI.Designer.cs @@ -61,7 +61,7 @@ namespace Observatory.Herald { } /// - /// Looks up a localized string similar to e698cf7e-0fbc-4e9a-b6a4-2480381afcc1. + /// Looks up a localized string similar to . /// internal static string ApiKey { get {