Added bet pool to a flood timer as well.

This commit is contained in:
Uno Polak 2014-01-06 14:50:41 -06:00
parent e4ab6185da
commit 1636a8a07e

View File

@ -1327,6 +1327,7 @@ Currency.prototype.bets = function(status, data) {
}
break;
case 'pool':
function do_work() {
if (__self.bets_board.length > 0) {
__self.irc.emit('message', {message:__self.pre_text + 'Current betting pool is:'});
for (var i = 0; i < __self.bets_board.length; i++) {
@ -1335,6 +1336,12 @@ Currency.prototype.bets = function(status, data) {
} else {
__self.irc.emit('message', {message:__self.pre_text + 'No current bet.'});
}
}
if (__self.bets_response_reset) {
__self.bets_response = setTimeout(function () {do_work();}, __self.bets_response_timer);
} else {
setTimeout(function () {do_work();}, __self.bets_response_timer);
}
break;
case 'winner':
if (!__self.bets_status) {