mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 20:43:52 -06:00
quick fix
This commit is contained in:
parent
e1540c853c
commit
2298f7cbc0
@ -144,16 +144,16 @@ export default class MapVote extends BasePlugin {
|
|||||||
const currentNextLayerExist = this.server.currentLayer && this.server.nextLayer;
|
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))) {
|
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 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 {
|
do {
|
||||||
|
const rndMap = randomElement(seedingMaps);
|
||||||
if (rndMap.layerid) {
|
if (rndMap.layerid) {
|
||||||
const nextMap = rndMap.layerid;
|
const nextMap = rndMap.layerid;
|
||||||
if (this.server.players && this.server.players.length < 20) {
|
if (this.server.players && this.server.players.length < 20) {
|
||||||
this.verbose(1, 'Going into seeding mode.');
|
this.verbose(1, 'Going into seeding mode.');
|
||||||
this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`);
|
this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`);
|
||||||
}
|
}
|
||||||
}else error = true;
|
} else error = true;
|
||||||
} while (error && ++tries<=5)
|
} while (error && ++tries <= 5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user