Commit 817c4ff4 authored by Eben Blaisdell's avatar Eben Blaisdell

isNaN fix

parent 46981d75
......@@ -143,7 +143,7 @@ function get(varName, scope){
function dzParseFloat(str){
var num = parseFloat(str);
if(num == NaN){
if(isNaN(num)){
return 0;
}
return num;
......
......@@ -459,7 +459,7 @@ Block.prototype.isOpen = function(dir){
//console.log("isOpen");
//console.log(dir);
dir = parseInt(dir);
if(dir==NaN){
if(isNaN(dir)){
return "false";
}
dir = this.untransformDir(dir);
......@@ -480,7 +480,7 @@ Block.prototype.move = function(dir){
this.actions--;
if(this.isOpen(dir)) {
dir = parseInt(dir);
if(dir==NaN){
if(isNaN(dir)){
return;
}
dir = this.untransformDir(dir);
......@@ -498,7 +498,7 @@ Block.prototype.attack = function(dir) {
}
this.actions--;
dir = parseInt(dir);
if(dir==NaN){
if(isNaN(dir)){
return;
}
dir = this.untransformDir(dir);
......@@ -519,7 +519,7 @@ Block.prototype.sendMessage = function(dir){
//console.log("sendMessage");
//console.log(dir);
dir = parseInt(dir);
if(dir==NaN){
if(isNaN(dir)){
return;
}
dir = this.untransformDir(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