Merge pull request #648 from zeratul0/patch-1

Change fallback voteskip ratio to .5 from 0
This commit is contained in:
Calvin Montgomery 2017-03-16 21:48:24 -07:00 committed by GitHub
commit d8b9e3dab6
1 changed files with 10 additions and 3 deletions

View File

@ -114,10 +114,17 @@ OptionsModule.prototype.handleSetOptions = function (user, data) {
if ("voteskip_ratio" in data) {
var ratio = parseFloat(data.voteskip_ratio);
if (isNaN(ratio) || ratio < 0) {
ratio = 0;
user.socket.emit("validationError", {
target: "#cs-voteskip_ratio",
message: `Input must be a number 0 or greater, not "${data.voteskip_ratio}"`
});
} else {
this.opts.voteskip_ratio = ratio;
sendUpdate = true;
user.socket.emit("validationPassed", {
target: "#cs-voteskip_ratio"
});
}
this.opts.voteskip_ratio = ratio;
sendUpdate = true;
}
if ("afk_timeout" in data) {