From 5cf19a72e374ceb2cd9134f7651ff6f35cf7899d Mon Sep 17 00:00:00 2001 From: Fantino Davide Date: Sun, 11 Sep 2022 01:01:43 +0200 Subject: [PATCH] fix --- mapvote.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapvote.js b/mapvote.js index bb8ebaf..df49c0b 100644 --- a/mapvote.js +++ b/mapvote.js @@ -312,7 +312,7 @@ export default class MapVote extends BasePlugin { const recentlyPlayedMaps = this.objArrToValArr(this.server.layerHistory.splice(0, this.options.numberRecentMapsToExlude), "layer", "map", "name"); this.verbose(1, "Recently played maps: " + recentlyPlayedMaps.join(', ')) - const all_layers = sanitizedLayers.filter((l) => l.layerid && l.map && this.options.gamemodeWhitelist.includes(l.gamemode.toUpperCase()) && (![ this.server.currentLayer.map.name, ...recentlyPlayedMaps ].includes(l.map.name)) && !this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase()))); + const all_layers = sanitizedLayers.filter((l) => l.layerid && l.map && this.options.gamemodeWhitelist.includes(l.gamemode.toUpperCase()) && (![ this.server.currentLayer ? this.server.currentLayer.map.name : null, ...recentlyPlayedMaps ].includes(l.map.name)) && !this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase()))); for (let i = 0; i < 6; i++) { let l, maxtries = 10; do l = randomElement(all_layers); while (rnd_layers.find(lf => lf.layerid == l.layerid) && --maxtries == 0) @@ -431,7 +431,7 @@ export default class MapVote extends BasePlugin { strMsg += (steamID, formatChoice(choice, this.nominations[ choice ], this.tallies[ choice ])) + "\n"; } strMsg.trim(); - if(steamID) this.warn(steamID, strMsg) + if (steamID) this.warn(steamID, strMsg) // const winners = this.currentWinners; // await this.msgDirect(steamID, `Current winner${winners.length > 1 ? "s" : ""}: ${winners.join(", ")}`);