From 491def387f6fa94626e54853d92436ad38e6ef12 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 28 Dec 2018 01:54:48 +0000 Subject: Always save availability as int --- scripts/toy.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/toy.groovy') 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"); -- cgit v1.2.3