made it so that plugin will fall back to defualt vote options when layer is not found

This commit is contained in:
maskedmonkyman 2022-04-23 16:20:01 -07:00
parent aaa4332826
commit 8fea07655d

View File

@ -272,17 +272,13 @@ export default class MapVote extends BasePlugin
//helpers
const splitName = name => name.substring(0, name.lastIndexOf("_"));
const removeCAF = name => name.replace("CAF_", "");
if (!this.server.currentLayer)
{
this.verbose(1, "Error: unknown currentLayer");
endVoting();
return;
}
let layerString = "";
if (this.server.currentLayer)
layerString = this.server.currentLayer.layerid
this.nominations = [];
const rulesList = this.voteRules.rules;
let layerString = this.server.currentLayer.layerid;
let nominationsList = rulesList.default;
//chomp string until we find a match