mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-24 01:23:52 -06:00
fixed automatic vote start during seeding always starting
This commit is contained in:
parent
07cf40008a
commit
97d813e54e
@ -581,6 +581,8 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
//checks if there are enough players to start voting, if not binds itself to player connected
|
//checks if there are enough players to start voting, if not binds itself to player connected
|
||||||
//when there are enough players it clears old votes, sets up new nominations, and starts broadcast
|
//when there are enough players it clears old votes, sets up new nominations, and starts broadcast
|
||||||
beginVoting(force = false, steamid = null, cmdLayers = []) {
|
beginVoting(force = false, steamid = null, cmdLayers = []) {
|
||||||
|
if (!this.options.automaticVoteStart && !force) return;
|
||||||
|
|
||||||
this.verbose(1, "Starting vote")
|
this.verbose(1, "Starting vote")
|
||||||
const playerCount = this.server.players.length;
|
const playerCount = this.server.players.length;
|
||||||
const minPlayers = this.options.minPlayersForVote;
|
const minPlayers = this.options.minPlayersForVote;
|
||||||
@ -588,6 +590,7 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
if (this.votingEnabled) //voting has already started
|
if (this.votingEnabled) //voting has already started
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (playerCount < minPlayers && !force) {
|
if (playerCount < minPlayers && !force) {
|
||||||
this.autovotestart = setTimeout(() => { this.beginVoting(force, steamid, cmdLayers) }, 60 * 1000)
|
this.autovotestart = setTimeout(() => { this.beginVoting(force, steamid, cmdLayers) }, 60 * 1000)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user