mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 17:13:54 -06:00
fixed bug where a second vote could start after new game
This commit is contained in:
parent
fa5fc98215
commit
0981a89bcb
@ -324,6 +324,10 @@ export default class MapVote extends BasePlugin
|
||||
{
|
||||
const playerCount = this.server.players.length;
|
||||
const minPlayers = this.options.minPlayersForVote;
|
||||
|
||||
if (this.votingEnabled) //voting has already started
|
||||
return;
|
||||
|
||||
if (playerCount < minPlayers && !force)
|
||||
{
|
||||
if (this.onConnectBound == false)
|
||||
@ -333,11 +337,12 @@ export default class MapVote extends BasePlugin
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(this.onConnectBound)
|
||||
if (this.onConnectBound)
|
||||
{
|
||||
this.server.removeEventListener("PLAYER_CONNECTED", this.beginVoting);
|
||||
this.onConnectBound = false;
|
||||
}
|
||||
|
||||
// these need to be reset after reenabling voting
|
||||
this.trackedVotes = {};
|
||||
this.tallies = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user