fix: vote end broadcast

This commit is contained in:
Davide Fantino 2023-03-18 01:22:12 +01:00
parent 09d117d86e
commit 20a2649b4a

View File

@ -703,13 +703,11 @@ export default class MapVote extends DiscordBasePlugin {
async endVotingGently(steamID = null) { async endVotingGently(steamID = null) {
if (!this.votingEnabled) return; if (!this.votingEnabled) return;
this.endVoting();
if (steamID) await this.warn(steamID, "Voting terminated!");
const winningLayerId = this.updateNextMap(); 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 winnerLayer = Layers.layers.find((l) => l.layerid == winningLayerId);
const fancyWinner = this.formatFancyLayer(winnerLayer); 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; return true;
} }
@ -1021,6 +1022,7 @@ export default class MapVote extends DiscordBasePlugin {
else // equal else // equal
ties.push(choice); ties.push(choice);
} }
this.verbose(1, 'Ties', ties, ties.map(i => this.nominations[ i ]))
} }
return ties.map(i => this.nominations[ i ]); return ties.map(i => this.nominations[ i ]);