From 694a0a1a2608bb9cbd9a722bedb41b69c5fcd2f7 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 13 Jul 2014 21:21:41 -0400 Subject: [PATCH] Fix checkbox and list item checks in parameter lists. * A checkbox is only true if it is actually true, not just non-nil. * If any check fails, then fail immediately. Before this was allowing any checkbox condition to be true as long as one of them was true. --- OvaleCompile.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OvaleCompile.lua b/OvaleCompile.lua index 60be45b..27693c6 100644 --- a/OvaleCompile.lua +++ b/OvaleCompile.lua @@ -137,8 +137,11 @@ local function TestConditions(parameters) Ovale.casesACocher[name] = control -- Check the value of the checkbox. profile = profile or OvaleOptions:GetProfile() - local isChecked = (profile.check[name] ~= nil) + local isChecked = profile.check[name] boolean = (required and isChecked) or (not required and not isChecked) + if not boolean then + break + end end end if boolean and parameters.listitem then @@ -151,6 +154,9 @@ local function TestConditions(parameters) profile = profile or OvaleOptions:GetProfile() local isSelected = (profile.list[list] == item) boolean = (required and isSelected) or (not required and not isSelected) + if not boolean then + break + end end end end -- 1.7.9.5