mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 18:23:52 -06:00
workaround for removeEventListener crash issue
This commit is contained in:
parent
2c0a048e25
commit
dcb50fe8af
@ -534,16 +534,12 @@ export default class MapVote extends DiscordBasePlugin {
|
||||
|
||||
if (playerCount < minPlayers && !force) {
|
||||
if (this.onConnectBound == false) {
|
||||
this.server.on("PLAYER_CONNECTED", this.beginVoting)
|
||||
setTimeout(() => { this.beginVoting(force, null, cmdLayers) }, 60 * 1000)
|
||||
this.onConnectBound = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.onConnectBound) {
|
||||
|
||||
this.server.removeEventListener("PLAYER_CONNECTED", this.beginVoting);
|
||||
this.onConnectBound = false;
|
||||
}
|
||||
this.onConnectBound = false;
|
||||
|
||||
// these need to be reset after reenabling voting
|
||||
this.trackedVotes = {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user