Commit 9db86fcc authored by Eben Blaisdell's avatar Eben Blaisdell

dzParseInt in index.js

parent d72add18
......@@ -335,14 +335,17 @@ builtinfuncs = {
bimove:function(scope){
//console.log("move");
scope.interp.block.move(ea(0,scope));
return "";
},
bimessage:function(scope){
//console.log("sendMessage");
scope.interp.block.sendMessage(ea(0,scope));
return "";
},
biattack:function(scope){
//console.log("sendMessage");
scope.interp.block.attack(ea(0,scope));
return "";
},
biisOpen:function(scope){
//console.log("sendMessage");
......
......@@ -474,6 +474,9 @@ Block.prototype.move = function(dir){
this.actions--;
if(this.isOpen(dir)) {
dir = parseInt(dir);
if(dir==NaN){
return;
}
dir = this.untransformDir(dir);
newx = this.x + Block.dx(dir);
newy = this.y + Block.dy(dir);
......@@ -489,6 +492,9 @@ Block.prototype.attack = function(dir) {
}
this.actions--;
dir = parseInt(dir);
if(dir==NaN){
return;
}
dir = this.untransformDir(dir);
attackx = this.x + Block.dx(dir);
attacky = this.y + Block.dy(dir);
......@@ -507,6 +513,9 @@ Block.prototype.sendMessage = function(dir){
//console.log("sendMessage");
//console.log(dir);
dir = parseInt(dir);
if(dir==NaN){
return;
}
dir = this.untransformDir(dir);
messagex = this.x + Block.dx(dir);
messagey = this.y + Block.dy(dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment