Automatically calculate cooldown

This commit is contained in:
calzoneman 2013-11-21 17:50:17 -06:00
parent d36dcc5352
commit 714d302cf9
4 changed files with 2 additions and 13 deletions

View file

@ -2111,9 +2111,7 @@ Channel.prototype.tryUpdateOptions = function(user, data) {
var s = parseFloat(data[key].sustained);
if (isNaN(s) || s <= 0)
s = 1;
var c = parseFloat(data[key].cooldown);
if (isNaN(c) || c < 0)
c = 0;
var c = b / s;
this.opts.chat_antiflood_params.burst = b;
this.opts.chat_antiflood_params.sustained = s;
this.opts.chat_antiflood_params.cooldown = c;