mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 20:43:52 -06:00
fix: untested. vote being carried to next match
This commit is contained in:
parent
246d904a92
commit
c3767bce85
@ -1025,9 +1025,10 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
const ties = [];
|
const ties = [];
|
||||||
|
|
||||||
let highestScore = -Infinity;
|
let highestScore = -Infinity;
|
||||||
|
const allScoreZero = this.tallies.find(s => s > 0) ? false : true;
|
||||||
for (let choice in this.tallies) {
|
for (let choice in this.tallies) {
|
||||||
const score = this.tallies[ choice ];
|
const score = this.tallies[ choice ];
|
||||||
if (score >= this.options.minimumVotesToAcceptResult) {
|
if (score >= this.options.minimumVotesToAcceptResult || allScoreZero) {
|
||||||
if (score < highestScore)
|
if (score < highestScore)
|
||||||
continue;
|
continue;
|
||||||
else if (score > highestScore) {
|
else if (score > highestScore) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user