mirror of
https://github.com/AsgardEternal/squad-js-map-vote.git
synced 2025-01-24 00:13:52 -06:00
moved some things around in populate nominations function to make it more clear
This commit is contained in:
parent
55c466ab3d
commit
1785a832a6
10
mapvote.js
10
mapvote.js
@ -239,22 +239,24 @@ export default class MapVote extends BasePlugin
|
|||||||
//TODO: right now if version is set to "Any" no caf layers will be selected
|
//TODO: right now if version is set to "Any" no caf layers will be selected
|
||||||
populateNominations() //gets nomination strings from layer options
|
populateNominations() //gets nomination strings from layer options
|
||||||
{
|
{
|
||||||
|
//helpers
|
||||||
|
const splitName = name => name.substring(0, name.lastIndexOf("_"));
|
||||||
|
const removeCAF = name => name.replace("CAF_", "");
|
||||||
|
const matchLayers = builtString => Layers.layers.filter((element) => element.layerid.startsWith(builtString));
|
||||||
|
|
||||||
if (!this.server.currentLayer)
|
if (!this.server.currentLayer)
|
||||||
{
|
{
|
||||||
this.verbose(1, "Error: unknown currentLayer");
|
this.verbose(1, "Error: unknown currentLayer");
|
||||||
endVoting();
|
endVoting();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const splitName = name => name.substring(0, name.lastIndexOf("_"));
|
|
||||||
const removeCAF = name => name.replace("CAF_", "");
|
|
||||||
|
|
||||||
this.nominations = [];
|
this.nominations = [];
|
||||||
const rulesList = this.voteRules.rules;
|
const rulesList = this.voteRules.rules;
|
||||||
let layerString = this.server.currentLayer.layerid;
|
let layerString = this.server.currentLayer.layerid;
|
||||||
let nominationsList = rulesList.default;
|
let nominationsList = rulesList.default;
|
||||||
|
|
||||||
const matchLayers = builtString => Layers.layers.filter((element) => element.layerid.startsWith(builtString));
|
//chomp string until we find a match
|
||||||
|
|
||||||
while(layerString.length > 0)
|
while(layerString.length > 0)
|
||||||
{
|
{
|
||||||
if(layerString in rulesList)
|
if(layerString in rulesList)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user