From 94cd830d7ef9d4c9e1ac4b37e6ec7e22c8d51d29 Mon Sep 17 00:00:00 2001 From: Davide Fantino <80767709+fantinodavide@users.noreply.github.com> Date: Sun, 20 Nov 2022 22:44:54 +0100 Subject: [PATCH] factions blacklist fixed --- mapvote.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mapvote.js b/mapvote.js index bfbee3b..5be6391 100644 --- a/mapvote.js +++ b/mapvote.js @@ -539,7 +539,7 @@ export default class MapVote extends DiscordBasePlugin { (cls[ 0 ] == "*" || l.layerid.toLowerCase().startsWith(cls[ 0 ])) && (l.gamemode.toLowerCase().startsWith(cls[ 1 ]) || (!cls[ 1 ] && [ 'RAAS', 'AAS', 'INVASION' ].includes(l.gamemode.toUpperCase()))) && (!cls[ 2 ] || l.version.toLowerCase().startsWith("v" + cls[ 2 ].replace(/v/gi, ''))) - && !(this.options.factionsBlacklist.find((f) => [ getTranslation(l.teams[ 0 ].faction), getTranslation(l.teams[ 1 ].faction) ].includes(f))) + && !(this.options.factionsBlacklist.find((f) => [ getTranslation(l.teams[ 0 ]), getTranslation(l.teams[ 1 ]) ].includes(f))) )); let l, maxtries = 10; do l = randomElement(fLayers); while ((rnd_layers.filter(lf => lf.map.name == l.map.name).length > (this.options.allowedSameMapEntries - 1)) && --maxtries >= 0) @@ -575,10 +575,10 @@ export default class MapVote extends DiscordBasePlugin { } - function getTranslation(t) { - if (translations[ t.faction ]) return translations[ t.faction ] - else if (t.faction) { - const f = t.faction.split(' '); + function getTranslation(layer) { + if (translations[ layer.faction ]) return translations[ layer.faction ] + else if (layer.faction) { + const f = layer.faction.split(' '); let fTag = ""; f.forEach((e) => { fTag += e[ 0 ] }); return fTag.toUpperCase();