layer filtering in seeding mode

This commit is contained in:
Fantino Davide 2022-09-06 13:44:31 +02:00
parent a1520af9df
commit 5ced2b07cc

View File

@ -139,8 +139,7 @@ export default class MapVote extends BasePlugin {
// setTimeout(()=>{this.msgDirect('76561198419229279',"MV\ntest\ntest")},1000)
// this.msgBroadcast("[MapVote] Seeding mode active")
if (this && this.options && this.server && this.options.automaticSeedingMode && ((this.server.nextLayer && this.server.nextLayer.gamemode.toLowerCase() != "seed") || this.server.currentLayer.layerid == this.server.nextLayer.layerid)) {
const mapBlacklist = [ /*"Black Coast"*/ ];
const seedingMaps = Layers.layers.filter((l) => l.gamemode.toUpperCase() == "SEED" && !mapBlacklist.includes(l.map.name) && l.layerid != this.server.currentLayer.layerid)
const seedingMaps = Layers.layers.filter((l) => l.gamemode.toUpperCase() == "SEED" && !mapBlacklist.includes(l.map.name) && l.layerid != this.server.currentLayer.layerid && !this.options.layerLevelBlacklist.find((fl)=>l.layerid.toLowerCase().startsWith(fl.toLowerCase())))
const nextMap = randomElement(seedingMaps).layerid;
if (this.server.players && this.server.players.length < 20) {