mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-24 01:23:52 -06:00
reduced AdminSetNextLayer calls
This commit is contained in:
parent
65a10a92d6
commit
2c0a048e25
@ -385,6 +385,8 @@ export default class MapVote extends DiscordBasePlugin {
|
|||||||
}
|
}
|
||||||
if (!skipSetNextMap) {
|
if (!skipSetNextMap) {
|
||||||
const nextMap = randomElement(cpyWinners);
|
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)
|
||||||
this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`);
|
this.server.rcon.execute(`AdminSetNextLayer ${nextMap}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user