summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/toy.groovy2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 7ba695f..3807e97 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -169,8 +169,8 @@ def can = {i -> loadBoolean("toy.permission.$i") == true};
def is = {i -> loadBoolean("toy.state.$i") == true};
def set = {i, s -> save("toy.state.$i", s)};
def positioned = { i -> loadString("toy.position") == i };
-def adjustPunish = { p -> save("toy.punishment", getPunish() + p); };
def getPunish = { loadInteger("toy.punishment"); };
+def adjustPunish = { p -> save("toy.punishment", Math.max(getPunish() + (int)p, 0)); };
def sessionAborted = null;
def gagText = { t, p ->
if (!is(GAGGED)) return t;