diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-13 21:15:31 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-13 21:15:31 +0000 |
commit | 8d7c725ba33aa5e0a226eae9f7ec929cabe13eba (patch) | |
tree | 9687a5ee04c6c849d1f20d1b9f28418a115eaf84 /scripts | |
parent | Configure owner in properties (diff) | |
download | toy-8d7c725ba33aa5e0a226eae9f7ec929cabe13eba.zip |
Move null val handling
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/toy.groovy | 7 |
1 files changed, 5 insertions, 2 deletions
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); } }; |