From 0553f420f8f2a864fcf985cbcc637de33f0068dd Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sun, 28 Oct 2018 13:34:27 -0500 Subject: [PATCH] Fix more issues found by LGTM These were overlooked in the last sweep. --- chat-plugins/thehappyplace.js | 2 +- mods/gen3/random-teams.js | 2 -- tournaments/index.js | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/chat-plugins/thehappyplace.js b/chat-plugins/thehappyplace.js index 283680356..1b6248763 100644 --- a/chat-plugins/thehappyplace.js +++ b/chat-plugins/thehappyplace.js @@ -31,7 +31,7 @@ exports.commands = { Rooms.global.writeChatRoomData(); return; } - const quote = target.split('|')[0].replace('"', ''); + const quote = target.split('|')[0].replace(/"/g, ''); const author = target.split('|')[1]; if (!quote) return; if (!author) { diff --git a/mods/gen3/random-teams.js b/mods/gen3/random-teams.js index 1b6012931..f885a3a22 100644 --- a/mods/gen3/random-teams.js +++ b/mods/gen3/random-teams.js @@ -10,7 +10,6 @@ class RandomGen3Teams extends RandomGen4Teams { * @return {RandomTeamsTypes["RandomSet"]} */ randomSet(template, slot, teamDetails = {}) { - if (slot === undefined) slot = 1; let baseTemplate = (template = this.getTemplate(template)); let species = template.species; @@ -500,7 +499,6 @@ class RandomGen3Teams extends RandomGen4Teams { } } - item = 'Leftovers'; if (template.requiredItems) { item = this.sample(template.requiredItems); diff --git a/tournaments/index.js b/tournaments/index.js index d731d5cea..b17810660 100644 --- a/tournaments/index.js +++ b/tournaments/index.js @@ -1039,7 +1039,7 @@ const commands = { if (result.charAt(0) === '1') { connection.popup("Your team is valid for this tournament."); } else { - const format = Dex.getFormat(tournament.originalFormat).name.replace(/\[/, '\\[').replace(/\]/, '\\]'); + const format = Dex.getFormat(tournament.originalFormat).name.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); connection.popup(`Your team was rejected for the following reasons:\n\n- ${result.slice(1).replace(/\n/g, '\n- ').replace(new RegExp(format, 'g'), 'this tournament')}`); } });