undid the Arguments.checkInteger change since it can break things (and did!), checking for actual int byte mask in hologram manually now

This commit is contained in:
Florian Nücke 2014-03-18 14:05:58 +01:00
parent 296daa7e1c
commit 3b5bb9487b
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class Hologram extends Environment with SidedEnvironment with Analyzable {
if (x < 0 || x >= width) throw new ArrayIndexOutOfBoundsException()
val z = args.checkInteger(1) - 1
if (z < 0 || z >= width) throw new ArrayIndexOutOfBoundsException()
val value = args.checkInteger(2)
val value = args.checkDouble(2).longValue.intValue
volume(x + z * width) = value
setDirty(x, z)
null

View File

@ -259,7 +259,7 @@ object Component {
def checkInteger(index: Int) = {
checkIndex(index, "number")
args(index) match {
case value: java.lang.Double => value.longValue.intValue
case value: java.lang.Double => value.intValue
case value => throw typeError(index, value, "number")
}
}