Merge pull request #178 from argonui/helpers

Fix two timing-related bugs in MythosArea
This commit is contained in:
Chr1Z 2023-01-10 07:57:20 +01:00 committed by GitHub
commit 7da588bd33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,10 +44,6 @@ end
-- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state -- Listens for cards entering the encounter deck or encounter discard, and resets the spawn state
-- for the cards when they do. -- for the cards when they do.
function onObjectEnterContainer(container, object) function onObjectEnterContainer(container, object)
Wait.frames(function() resetTokensIfInDeckZone(container, object) end, 1)
end
function resetTokensIfInDeckZone(container, object)
local localPos = self.positionToLocal(container.getPosition()) local localPos = self.positionToLocal(container.getPosition())
if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then if inArea(localPos, ENCOUNTER_DECK_AREA) or inArea(localPos, ENCOUNTER_DISCARD_AREA) then
tokenSpawnTracker.resetTokensSpawned(object.getGUID()) tokenSpawnTracker.resetTokensSpawned(object.getGUID())
@ -55,7 +51,7 @@ function resetTokensIfInDeckZone(container, object)
end end
function fireScenarioChangedEvent() function fireScenarioChangedEvent()
Global.call('titleSplash', currentScenario) Wait.frames(function() Global.call('titleSplash', currentScenario) end, 20)
playArea.onScenarioChanged(currentScenario) playArea.onScenarioChanged(currentScenario)
end end