Created
February 12, 2012 22:27
-
-
Save thejh/1811209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// wrong | |
var playerRooms = function(id){ | |
client.hget("player_" + user.id, "total", function(err, rep){ | |
if (parseInt(resp) >= max_rooms && max_rooms > 0) { | |
return false; | |
} else { | |
return true; | |
} | |
}); | |
}; | |
// should work | |
var playerRooms = function(id, cb){ | |
client.hget("player_" + user.id, "total", function(err, rep){ | |
cb( ! (parseInt(resp) >= max_rooms && max_rooms > 0) ) | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment