mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 23:03:51 -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 playerCount = this.server.players.length;
|
||||||
const minPlayers = this.options.minPlayersForVote;
|
const minPlayers = this.options.minPlayersForVote;
|
||||||
|
|
||||||
|
if (this.votingEnabled) //voting has already started
|
||||||
|
return;
|
||||||
|
|
||||||
if (playerCount < minPlayers && !force)
|
if (playerCount < minPlayers && !force)
|
||||||
{
|
{
|
||||||
if (this.onConnectBound == false)
|
if (this.onConnectBound == false)
|
||||||
@ -333,11 +337,12 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// these need to be reset after reenabling voting
|
// these need to be reset after reenabling voting
|
||||||
this.trackedVotes = {};
|
this.trackedVotes = {};
|
||||||
this.tallies = [];
|
this.tallies = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user