Merge pull request #664 from dscarpac/discard-pile-tokens

Bugfix: Discard tokens that are on cards that enter discard pile deck
This commit is contained in:
Chr1Z 2024-04-24 18:33:57 +02:00 committed by GitHub
commit c9b8ae3a51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,12 +99,13 @@ function onCollisionExit(collisionInfo)
end
end
-- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state
-- for the cards when they do.
-- Listens for cards entering the encounter deck or encounter discard, discards tokens on them,
-- and resets the spawn state for the cards when they do.
function onObjectEnterContainer(container, object)
local localPos = self.positionToLocal(container.getPosition())
if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then
tokenSpawnTrackerApi.resetTokensSpawned(object.getGUID())
removeTokensFromObject(object)
end
end