update mapvote

This commit is contained in:
Skillet 2023-04-26 09:53:28 -04:00
parent 025e347ba5
commit ab8d914ab3

View File

@ -693,7 +693,7 @@ export default class MapVote extends DiscordBasePlugin {
// this.verbose(1, 'rnd_layers', rnd_layers.map(l => l.layerid)); // this.verbose(1, 'rnd_layers', rnd_layers.map(l => l.layerid));
let l; let l;
let maxtries = 10; 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) { if (l) {
rnd_layers.push(l); rnd_layers.push(l);
this.nominations[i] = l.layerid this.nominations[i] = l.layerid