From ffab6d5c43d17a6624da57f6b834b994afed60c3 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 19 Nov 2024 23:05:33 +0100 Subject: [PATCH] Added token verification to cards that seal --- src/playercards/CardsThatSealTokens.ttslua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index 74eaf35b..9d4717d0 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -114,7 +114,14 @@ function updateSave() end function onLoad(savedData) - sealedTokens = JSON.decode(savedData) or {} + -- verify sealed tokens + for _, guid in ipairs(JSON.decode(savedData) or {}) do + local token = getObjectFromGUID(guid) + if token ~= nil then + table.insert(sealedTokens, guid) + end + end + ID_URL_MAP = chaosBagApi.getIdUrlMap() generateContextMenu() updateStackSize()