mirror of https://github.com/calzoneman/sync.git
A couple of voteskip fixes
This commit is contained in:
parent
b9ccf05416
commit
ba8730b722
|
@ -642,6 +642,8 @@ Channel.prototype.userLeave = function(user) {
|
||||||
var idx = this.users.indexOf(user);
|
var idx = this.users.indexOf(user);
|
||||||
if(idx >= 0 && idx < this.users.length)
|
if(idx >= 0 && idx < this.users.length)
|
||||||
this.users.splice(idx, 1);
|
this.users.splice(idx, 1);
|
||||||
|
if(user.meta.afk)
|
||||||
|
this.afkcount--;
|
||||||
this.broadcastVoteskipUpdate();
|
this.broadcastVoteskipUpdate();
|
||||||
this.broadcastUsercount();
|
this.broadcastUsercount();
|
||||||
if(user.name != "") {
|
if(user.name != "") {
|
||||||
|
@ -961,8 +963,8 @@ Channel.prototype.broadcastChatFilters = function() {
|
||||||
|
|
||||||
Channel.prototype.broadcastVoteskipUpdate = function() {
|
Channel.prototype.broadcastVoteskipUpdate = function() {
|
||||||
var amt = this.voteskip ? this.voteskip.counts[0] : 0;
|
var amt = this.voteskip ? this.voteskip.counts[0] : 0;
|
||||||
var need = this.voteskip ? parseInt(this.users.length * this.opts.voteskip_ratio) : 0;
|
var count = this.users.length - this.afkcount;
|
||||||
need -= this.afkcount;
|
var need = this.voteskip ? parseInt(count * this.opts.voteskip_ratio) : 0;
|
||||||
for(var i = 0; i < this.users.length; i++) {
|
for(var i = 0; i < this.users.length; i++) {
|
||||||
if(Rank.hasPermission(this.users[i], "seeVoteskip") ||
|
if(Rank.hasPermission(this.users[i], "seeVoteskip") ||
|
||||||
this.leader == this.users[i]) {
|
this.leader == this.users[i]) {
|
||||||
|
|
Loading…
Reference in New Issue