diff --git a/mapvote.js b/mapvote.js index bec124e..74a6d63 100644 --- a/mapvote.js +++ b/mapvote.js @@ -144,16 +144,16 @@ export default class MapVote extends BasePlugin { const currentNextLayerExist = this.server.currentLayer && this.server.nextLayer; if (baseDataExist && this.options.automaticSeedingMode && ((this.server.nextLayer && this.server.nextLayer.gamemode.toLowerCase() != "seed") || (currentNextLayerExist && this.server.currentLayer.layerid == this.server.nextLayer.layerid))) { const seedingMaps = Layers.layers.filter((l) => l.gamemode.toUpperCase() == "SEED" && (currentNextLayerExist && l.layerid != this.server.currentLayer.layerid && !this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase())))) - const rndMap = randomElement(seedingMaps); do { + const rndMap = randomElement(seedingMaps); if (rndMap.layerid) { const nextMap = rndMap.layerid; if (this.server.players && this.server.players.length < 20) { this.verbose(1, 'Going into seeding mode.'); this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`); } - }else error = true; - } while (error && ++tries<=5) + } else error = true; + } while (error && ++tries <= 5) } }