From ab8d914ab31c29c0cf7eb6392fbc6201392f08d7 Mon Sep 17 00:00:00 2001 From: Skillet Date: Wed, 26 Apr 2023 09:53:28 -0400 Subject: [PATCH] update mapvote --- mapvote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapvote.js b/mapvote.js index 45e2115..c668451 100644 --- a/mapvote.js +++ b/mapvote.js @@ -693,7 +693,7 @@ export default class MapVote extends DiscordBasePlugin { // this.verbose(1, 'rnd_layers', rnd_layers.map(l => l.layerid)); let l; let maxtries = 10; - do l = randomElement(fLayers); while ((rnd_layers.filter(lf => lf.map.name === l.map.name).length > (this.options.allowedSameMapEntries - 1)) && --maxtries >= 0) + do l = randomElement(fLayers); while ((rnd_layers.filter(lf => lf.map.name === l.map.name).length > (this.options.allowedSameMapEntries - 1)) && --maxtries >= 0 && !rnd_layers.find((e) => e === l)) if (l) { rnd_layers.push(l); this.nominations[i] = l.layerid