Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eben Blaisdell
blockcode
Commits
817c4ff4
Commit
817c4ff4
authored
Feb 10, 2017
by
Eben Blaisdell
Browse files
isNaN fix
parent
46981d75
Changes
2
Hide whitespace changes
Inline
Side-by-side
bcfe.js
View file @
817c4ff4
...
...
@@ -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
;
...
...
index.js
View file @
817c4ff4
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment