mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 21:53:52 -06:00
fix: vote end broadcast
This commit is contained in:
parent
09d117d86e
commit
20a2649b4a
14
mapvote.js
14
mapvote.js
@ -703,13 +703,11 @@ export default class MapVote extends DiscordBasePlugin {
|
||||
async endVotingGently(steamID = null) {
|
||||
if (!this.votingEnabled) return;
|
||||
|
||||
this.endVoting();
|
||||
|
||||
if (steamID) await this.warn(steamID, "Voting terminated!");
|
||||
|
||||
const winningLayerId = this.updateNextMap();
|
||||
if (!winningLayerId) return;
|
||||
|
||||
if (!winningLayerId) {
|
||||
this.verbose(1, 'No winning layer available', winningLayerId)
|
||||
return;
|
||||
}
|
||||
const winnerLayer = Layers.layers.find((l) => l.layerid == winningLayerId);
|
||||
const fancyWinner = this.formatFancyLayer(winnerLayer);
|
||||
|
||||
@ -762,6 +760,9 @@ export default class MapVote extends DiscordBasePlugin {
|
||||
});
|
||||
}
|
||||
|
||||
this.endVoting();
|
||||
if (steamID) await this.warn(steamID, "Voting terminated!");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1021,6 +1022,7 @@ export default class MapVote extends DiscordBasePlugin {
|
||||
else // equal
|
||||
ties.push(choice);
|
||||
}
|
||||
this.verbose(1, 'Ties', ties, ties.map(i => this.nominations[ i ]))
|
||||
}
|
||||
|
||||
return ties.map(i => this.nominations[ i ]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user