mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-24 02:33: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 (playerCount < minPlayers && !force) {
|
||||||
if (this.onConnectBound == false) {
|
if (this.onConnectBound == false) {
|
||||||
this.server.on("PLAYER_CONNECTED", this.beginVoting)
|
setTimeout(() => { this.beginVoting(force, null, cmdLayers) }, 60 * 1000)
|
||||||
this.onConnectBound = true;
|
this.onConnectBound = true;
|
||||||
}
|
}
|
||||||
return;
|
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
|
// these need to be reset after reenabling voting
|
||||||
this.trackedVotes = {};
|
this.trackedVotes = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user