mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-23 23:03:51 -06:00
updateNextMap
This commit is contained in:
parent
12607a3d2e
commit
c8370673d5
@ -396,9 +396,11 @@ export default class MapVote extends DiscordBasePlugin {
|
||||
}
|
||||
if (!skipSetNextMap) {
|
||||
const nextMap = randomElement(cpyWinners);
|
||||
const baseDataExist = this && this.options && this.server && this.server.players && this.server.nextLayer && this.server.nextLayer.layerid;
|
||||
if (!baseDataExist || this.server.nextLayer.layerid != nextMap)
|
||||
const baseDataExist = this && this.server;
|
||||
const layerDataExist = this.server.nextLayer && this.server.nextLayer.layerid;
|
||||
if (baseDataExist && (!layerDataExist || this.server.nextLayer.layerid != nextMap))
|
||||
this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`);
|
||||
else console.log("[MapVote][1] Bad data (this/this.server). Next layer not set to prevent errors.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user