quick fix

This commit is contained in:
Fantino Davide 2022-09-07 22:07:13 +02:00
parent c9458063e4
commit 5b762b4796

View File

@ -138,8 +138,10 @@ export default class MapVote extends BasePlugin {
setSeedingMode() { setSeedingMode() {
// setTimeout(()=>{this.msgDirect('76561198419229279',"MV\ntest\ntest")},1000) // setTimeout(()=>{this.msgDirect('76561198419229279',"MV\ntest\ntest")},1000)
// this.msgBroadcast("[MapVote] Seeding mode active") // 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 && this.server.nextLayer && this.server.currentLayer.layerid == this.server.nextLayer.layerid))) { const baseDataExist = this && this.options && this.server;
const seedingMaps = Layers.layers.filter((l) => l.gamemode.toUpperCase() == "SEED" && l.layerid != this.server.currentLayer.layerid && !this.options.layerLevelBlacklist.find((fl) => l.layerid.toLowerCase().startsWith(fl.toLowerCase()))) 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 nextMap = randomElement(seedingMaps).layerid; const nextMap = randomElement(seedingMaps).layerid;
if (this.server.players && this.server.players.length < 20) { if (this.server.players && this.server.players.length < 20) {