Merge pull request #880 from argonui/custom-sig-excluding

Exclude custom sigs from weakness spread
This commit is contained in:
dscarpac 2024-09-23 13:09:43 -05:00 committed by GitHub
commit 11b7b1776c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -800,13 +800,22 @@ function spawnWeaknesses()
prepareToPlaceCards()
-- exclude custom signature weaknesses
local customExcludeList = {}
local customInvestigatorData = allCardsBagApi.getCustomInvestigatorData()
for investigatorId, invdata in pairs(customInvestigatorData.InvestigatorSubdata or {}) do
for _, cardId in ipairs(invdata.signatures or {}) do
customExcludeList[cardId] = true
end
end
local basicWeaknessList = {}
local otherWeaknessList = {}
for _, id in ipairs(allCardsBagApi.getUniqueWeaknesses()) do
local cardMetadata = allCardsBagApi.getCardById(id).metadata
if cardMetadata.basicWeaknessCount ~= nil and cardMetadata.basicWeaknessCount > 0 then
table.insert(basicWeaknessList, id)
elseif excludedNonBasicWeaknesses[id] == nil then
elseif excludedNonBasicWeaknesses[id] == nil and customExcludeList[id] == nil then
table.insert(otherWeaknessList, id)
end
end