From 97d813e54e641162e038dc1e0262beeee223e38e Mon Sep 17 00:00:00 2001 From: Davide Fantino <80767709+fantinodavide@users.noreply.github.com> Date: Mon, 7 Nov 2022 13:03:26 +0100 Subject: [PATCH] fixed automatic vote start during seeding always starting --- mapvote.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mapvote.js b/mapvote.js index dba8b2b..fcc5015 100644 --- a/mapvote.js +++ b/mapvote.js @@ -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 //when there are enough players it clears old votes, sets up new nominations, and starts broadcast beginVoting(force = false, steamid = null, cmdLayers = []) { + if (!this.options.automaticVoteStart && !force) return; + this.verbose(1, "Starting vote") const playerCount = this.server.players.length; const minPlayers = this.options.minPlayersForVote; @@ -588,6 +590,7 @@ export default class MapVote extends DiscordBasePlugin { if (this.votingEnabled) //voting has already started return; + if (playerCount < minPlayers && !force) { this.autovotestart = setTimeout(() => { this.beginVoting(force, steamid, cmdLayers) }, 60 * 1000) return;