This commit is contained in:
Florian Nücke 2014-03-18 14:06:19 +01:00
commit c8fa07c2b9
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")
}
}