mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 20:43:52 -06:00
hotfix
This commit is contained in:
parent
2010dffbdf
commit
09bae31e41
22
mapvote.js
22
mapvote.js
@ -105,6 +105,11 @@ export default class MapVote extends BasePlugin {
|
|||||||
this.broadcastIntervalTask = null;
|
this.broadcastIntervalTask = null;
|
||||||
this.firstBroadcast = true;
|
this.firstBroadcast = true;
|
||||||
this.newVoteTimeout = null;
|
this.newVoteTimeout = null;
|
||||||
|
this.newVoteOptions = {
|
||||||
|
steamid: null,
|
||||||
|
cmdLayers: [],
|
||||||
|
bypassRaasFilter: false
|
||||||
|
};
|
||||||
|
|
||||||
this.onNewGame = this.onNewGame.bind(this);
|
this.onNewGame = this.onNewGame.bind(this);
|
||||||
this.onPlayerDisconnected = this.onPlayerDisconnected.bind(this);
|
this.onPlayerDisconnected = this.onPlayerDisconnected.bind(this);
|
||||||
@ -376,9 +381,10 @@ export default class MapVote extends BasePlugin {
|
|||||||
if (this.currentWinners.find(e => e == this.nominations[ 0 ]) && this.currentWinners.length == 1) {
|
if (this.currentWinners.find(e => e == this.nominations[ 0 ]) && this.currentWinners.length == 1) {
|
||||||
this.newVoteTimeout = null;
|
this.newVoteTimeout = null;
|
||||||
this.endVoting()
|
this.endVoting()
|
||||||
this.beginVoting(true)
|
this.beginVoting(true, this.newVoteOptions.steamid, this.newVoteOptions.cmdLayers)
|
||||||
}
|
}
|
||||||
}, 2 * 60 * 1000)
|
}, 2 * 60 * 1000)
|
||||||
|
setTimeout(this.broadcastNominations, 1 * 60 * 1000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -485,13 +491,19 @@ export default class MapVote extends BasePlugin {
|
|||||||
|
|
||||||
if (this.options.showRerollOption) {
|
if (this.options.showRerollOption) {
|
||||||
if (this.nominations.length > 5) {
|
if (this.nominations.length > 5) {
|
||||||
this.nominations.splice(5, 1);
|
this.nominations.splice(6, 1);
|
||||||
this.tallies.splice(5, 1);
|
this.tallies.splice(6, 1);
|
||||||
this.factionStrings.splice(5, 1);
|
this.factionStrings.splice(6, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.newVoteOptions.steamid = steamid;
|
||||||
|
this.newVoteOptions.bypassRaasFilter = bypassRaasFilter;
|
||||||
|
this.newVoteOptions.cmdLayers = cmdLayers;
|
||||||
|
|
||||||
this.nominations[ 0 ] = "Reroll vote list with random options"
|
this.nominations[ 0 ] = "Reroll vote list with random options"
|
||||||
this.tallies[ 0 ] = 0;
|
this.tallies[ 0 ] = 0;
|
||||||
this.factionStrings[ 0 ] = "";
|
this.factionStrings[ 0 ] = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTranslation(t) {
|
function getTranslation(t) {
|
||||||
@ -523,7 +535,7 @@ export default class MapVote extends BasePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.onConnectBound) {
|
if (this.onConnectBound) {
|
||||||
|
|
||||||
this.server.removeEventListener("PLAYER_CONNECTED", this.beginVoting);
|
this.server.removeEventListener("PLAYER_CONNECTED", this.beginVoting);
|
||||||
this.onConnectBound = false;
|
this.onConnectBound = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user