diff --git a/src/playercards/CardsThatSealTokens.ttslua b/src/playercards/CardsThatSealTokens.ttslua index ec327c6a..2c87487a 100644 --- a/src/playercards/CardsThatSealTokens.ttslua +++ b/src/playercards/CardsThatSealTokens.ttslua @@ -183,9 +183,12 @@ function readBag() end end +-- save state when going into bags / decks +function onDestroy() self.script_state = onSave() end + function resetSealedTokens() - log("Resetting") sealedTokens = {} + self.script_state = onSave() end -- native event from TTS - used to update the context menu for cards like "Unrelenting" @@ -245,8 +248,6 @@ function releaseOneToken(playerColor) else printToColor("Releasing token", playerColor) putTokenAway(table.remove(sealedTokens)) - log("Removed one") - log(#sealedTokens) end end @@ -278,9 +279,8 @@ function releaseAllTokens(playerColor) for _, guid in ipairs(sealedTokens) do putTokenAway(guid) end - log("Removed all") - log(#sealedTokens) sealedTokens = {} + self.script_state = onSave() end end