From d67d1192cf4a030cd67dd5e9177c448b55bccfab Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 8 Sep 2021 22:34:13 -0400 Subject: [PATCH] Don't include a faction if the card type doesn't have one ie treachery weaknesses --- strange_eons_to_arkhamdb.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/strange_eons_to_arkhamdb.js b/strange_eons_to_arkhamdb.js index 4d7ccdf..b6abb89 100644 --- a/strange_eons_to_arkhamdb.js +++ b/strange_eons_to_arkhamdb.js @@ -101,7 +101,6 @@ function build_card(component) { var card_data = { code: String(code), deck_limit: 2, // TODO: could be derived? - faction_code: String(component.settings.get('CardClass')).toLowerCase(), flavor: substitute_tags(String(component.settings.get('Flavor'))), illustrator: String(component.settings.get('Artist')), is_unique: component.settings.getBoolean('Unique'), @@ -165,9 +164,13 @@ function build_card(component) { card_data.subname = String(subtitle); } - var faction2 = component.settings.get('CardClass2'); - if (faction2 && faction2 != 'None') { - card_data.faction2_code = String(faction2).toLowerCase(); + var faction = component.settings.get('CardClass'); + if (faction) { + card_data.faction_code = String(faction).toLowerCase(); + var faction2 = component.settings.get('CardClass2'); + if (faction2 && faction2 != 'None') { + card_data.faction2_code = String(faction2).toLowerCase(); + } } if (card_types[component.getFrontTemplateKey()] == 'enemy') {