Don't assume that cards have traits in the deck importer
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
Adam Goldsmith 2022-11-26 22:13:58 -05:00
parent c31e508061
commit 588a24b77a

View File

@ -1050,7 +1050,7 @@ function handleUnderworldMarket(cardList, playerColor)
-- Underworld Market found -- Underworld Market found
hasMarket = true hasMarket = true
card.zone = "SetAside3" card.zone = "SetAside3"
elseif (string.find(card.metadata.traits, "Illicit", 1, true) elseif (string.find(card.metadata.traits or "", "Illicit", 1, true)
and card.metadata.bonded_to == nil and card.metadata.bonded_to == nil
and not card.metadata.weakness) then and not card.metadata.weakness) then
table.insert(illicitList, i) table.insert(illicitList, i)
@ -1093,7 +1093,7 @@ function handleHunchDeck(investigatorId, cardList, playerColor)
local insightList = {} local insightList = {}
for i, card in ipairs(cardList) do for i, card in ipairs(cardList) do
if (card.metadata.type == "Event" if (card.metadata.type == "Event"
and string.match(card.metadata.traits, "Insight") and string.match(card.metadata.traits or "", "Insight")
and card.metadata.bonded_to == nil) then and card.metadata.bonded_to == nil) then
table.insert(insightList, i) table.insert(insightList, i)
end end