From 8fea07655d1c575728778d64d3d87e3e7a761949 Mon Sep 17 00:00:00 2001 From: maskedmonkyman Date: Sat, 23 Apr 2022 16:20:01 -0700 Subject: [PATCH] made it so that plugin will fall back to defualt vote options when layer is not found --- mapvote.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mapvote.js b/mapvote.js index 127398f..e448fcb 100644 --- a/mapvote.js +++ b/mapvote.js @@ -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