From f5b60223bbcc2a0d8d30e0b5e7e5e53cddc6518b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 19 Sep 2024 18:50:08 +0200 Subject: [PATCH] Exclude custom sigs from weakness spread --- src/playercards/PlayerCardPanel.ttslua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/playercards/PlayerCardPanel.ttslua b/src/playercards/PlayerCardPanel.ttslua index a404f8e9..bb4959f3 100644 --- a/src/playercards/PlayerCardPanel.ttslua +++ b/src/playercards/PlayerCardPanel.ttslua @@ -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