From 8d7c725ba33aa5e0a226eae9f7ec929cabe13eba Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 13 Dec 2018 21:15:31 +0000 Subject: Move null val handling --- scripts/toy.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts/toy.groovy') diff --git a/scripts/toy.groovy b/scripts/toy.groovy index d8651ff..647a1d7 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -968,11 +968,14 @@ def sessionPlay = { } }; def ap = { val -> - adjustPunish(-val * ph); + if (val) { + adjustPunish(-val * ph); + } }; def apply = { activitity, use = null -> + if (!activitity) return; def val = (Float)activitity(); - if (val && use) { + if (use) { use(val); } }; -- cgit v1.2.3