summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-12-28 01:54:48 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-12-28 01:54:48 +0000
commit491def387f6fa94626e54853d92436ad38e6ef12 (patch)
tree41ff441722cca56a8b11e5dc0880aaa0b28298af /scripts
parentFix and dedupe bug where clamp play would occur without context if toy alread... (diff)
downloadtoy-491def387f6fa94626e54853d92436ad38e6ef12.zip
Always save availability as int
Diffstat (limited to 'scripts')
-rw-r--r--scripts/toy.groovy2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index 6918f38..ce64ba6 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -1504,7 +1504,7 @@ def getDayNum = { Math.floorDiv(getTime() + localTimeOffset() - 14400, 86400) };
def getAvail = { dayNum -> loadInteger("toy.availability.$dayNum") ?: 0 };
def addAvail = { amount ->
def dayNum = getDayNum();
- save("toy.availability.$dayNum", getAvail(dayNum) + amount);
+ save("toy.availability.$dayNum", (int)(getAvail(dayNum) + amount));
};
def tidyAvail = {
def p = load("toy.availability");