diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-28 01:54:48 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-28 01:54:48 +0000 |
commit | 491def387f6fa94626e54853d92436ad38e6ef12 (patch) | |
tree | 41ff441722cca56a8b11e5dc0880aaa0b28298af | |
parent | Fix and dedupe bug where clamp play would occur without context if toy alread... (diff) | |
download | toy-491def387f6fa94626e54853d92436ad38e6ef12.zip |
Always save availability as int
-rw-r--r-- | scripts/toy.groovy | 2 |
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"); |