From 86176a21069d6f85d5a60e5e9562fa5e44312e37 Mon Sep 17 00:00:00 2001 From: Skillet Date: Mon, 17 Apr 2023 23:25:23 -0400 Subject: [PATCH] fixes --- mapvote.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mapvote.js b/mapvote.js index ab1aaeb..f8a9745 100644 --- a/mapvote.js +++ b/mapvote.js @@ -1116,16 +1116,18 @@ export default class MapVote extends DiscordBasePlugin { 'http://hub.afocommunity.com/api/layers.json', [0, 1959152751] ); - for (const layer of response.data.Maps) { - if (!Layers.layers.find((e) => e.layerid === layer.rawName)){ - const hellolayer = new Layer(layer); - Layers._layers.set(hellolayer.layerid, hellolayer); - } - } - const rconLayers = (await this.server.rcon.execute('ListLayers'))?.split('\n') || []; rconLayers.shift(); + for (const layer of response.data.Maps) { + if (!Layers.layers.find((e) => e.layerid === layer.rawName)){ + if(rconLayers.find((e) => e.layer === layer.rawName)) { + const hellolayer = new Layer(layer); + Layers._layers.set(hellolayer.layerid, hellolayer); + } + } + } + // this.verbose(1, 'RCON Layers', rconLayers.length, this.mapLayer(rconLayers[ 0 ])) for (const layer of rconLayers) { if (!Layers.layers.find((e) => e?.layerid === layer)) {