summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-12-13 21:15:31 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-12-13 21:15:31 +0000
commit8d7c725ba33aa5e0a226eae9f7ec929cabe13eba (patch)
tree9687a5ee04c6c849d1f20d1b9f28418a115eaf84 /scripts
parentConfigure owner in properties (diff)
downloadtoy-8d7c725ba33aa5e0a226eae9f7ec929cabe13eba.zip
Move null val handling
Diffstat (limited to 'scripts')
-rw-r--r--scripts/toy.groovy7
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);
}
};