Merge pull request #741 from argonui/exit-error

Added 1 frame delay to avoid error when exiting
This commit is contained in:
dscarpac 2024-07-03 17:16:58 -05:00 committed by GitHub
commit d76b1b7ea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -212,10 +212,14 @@ end
-- TTS event for objects that leave zones -- TTS event for objects that leave zones
function onObjectLeaveZone(zone, object) function onObjectLeaveZone(zone, object)
if zone.isDestroyed() or object.isDestroyed() then return end -- 1 frame delay to avoid error messages when exiting the game
if zone.type == "Hand" and object.hasTag("CardWithHelper") then Wait.frames(
object.call("updateDisplay") function()
end if zone.isDestroyed() or object.isDestroyed() then return end
if zone.type == "Hand" and object.hasTag("CardWithHelper") then
object.call("updateDisplay")
end
end, 1)
end end
-- handle card drawing via number typing for multihanded gameplay -- handle card drawing via number typing for multihanded gameplay
@ -1364,7 +1368,8 @@ function contentDownloadCallback(request, params)
if pos then if pos then
spawnTable.position = pos spawnTable.position = pos
else else
broadcastToAll("Please make space in the area below the tentacle stand in the upper middle of the table and try again.", "Red") broadcastToAll(
"Please make space in the area below the tentacle stand in the upper middle of the table and try again.", "Red")
return return
end end
end end
@ -1515,10 +1520,11 @@ function playermatRemovalSelected(player, selectedIndex, id)
if mat then if mat then
-- confirmation dialog about deletion -- confirmation dialog about deletion
player.pingTable(mat.getPosition()) player.pingTable(mat.getPosition())
player.showConfirmDialog("Do you really want to remove " .. matColor .. "'s playermat and related objects? This can't be reversed.", player.showConfirmDialog(
function() "Do you really want to remove " .. matColor .. "'s playermat and related objects? This can't be reversed.",
removePlayermat(matColor) function()
end) removePlayermat(matColor)
end)
else else
-- info dialog that it is already deleted -- info dialog that it is already deleted
player.showInfoDialog(matColor .. "'s playermat has already been removed.") player.showInfoDialog(matColor .. "'s playermat has already been removed.")
@ -1593,6 +1599,7 @@ function applyOptionPanelChange(id, state)
local counter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "MasterClueCounter") local counter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "MasterClueCounter")
counter.setVar("useClickableCounters", state) counter.setVar("useClickableCounters", state)
-- option: Enable card helpers
elseif id == "enableCardHelpers" then elseif id == "enableCardHelpers" then
toggleCardHelpers(state) toggleCardHelpers(state)