bugfix for goto
This commit is contained in:
parent
5c53ca9c9c
commit
102ebb6898
@ -284,7 +284,6 @@ end
|
||||
-- maybe ignore cards / decks on the tekelili helper
|
||||
function maybeIgnoreTekeliliCards()
|
||||
local tekeliliHelper = getTekeliliHelper()
|
||||
|
||||
if tekeliliHelper then
|
||||
removeIgnoreLater = searchLib.onObject(tekeliliHelper, "isCardOrDeck")
|
||||
for _, obj in ipairs(removeIgnoreLater) do
|
||||
@ -295,10 +294,7 @@ end
|
||||
|
||||
-- clean up for play area
|
||||
function tidyPlayareaCoroutine()
|
||||
-- small wait to allow other operations to finish
|
||||
for k = 1, 10 do
|
||||
coroutine.yield(0)
|
||||
end
|
||||
coWaitFrames(10)
|
||||
|
||||
local trash = guidReferenceApi.getObjectByOwnerAndType("Mythos", "Trash")
|
||||
local playAreaZone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone")
|
||||
@ -333,25 +329,30 @@ function tidyPlayerMatCoroutine()
|
||||
|
||||
if getOptionValue() then
|
||||
for _, color in ipairs(COLORS) do
|
||||
-- delay for animation purpose
|
||||
for k = 1, 20 do
|
||||
coroutine.yield(0)
|
||||
end
|
||||
|
||||
-- get respective trash
|
||||
local trash = guidReferenceApi.getObjectByOwnerAndType(color, "Trash")
|
||||
if trash == nil then
|
||||
printToAll("Trashcan for " .. color .. " playermat could not be found! Skipping this playermat.", "Yellow")
|
||||
goto continue
|
||||
end
|
||||
else
|
||||
coWaitFrames(20)
|
||||
|
||||
-- maybe store tekelili cards
|
||||
if tekeliliHelper then
|
||||
tekeliliHelper.call("storeTekelili", color)
|
||||
end
|
||||
|
||||
-- remove objects (with exceptions)
|
||||
-- parse playermat objects
|
||||
for _, obj in ipairs(playermatApi.searchAroundPlayermat(color)) do
|
||||
-- reset action tokens
|
||||
if obj.hasTag("UniversalToken") and obj.is_face_down then
|
||||
obj.flip()
|
||||
end
|
||||
|
||||
-- get rid of temporary tokens
|
||||
if obj.hasTag("Temporary") then
|
||||
trash.putObject(obj)
|
||||
end
|
||||
|
||||
-- remove objects (with exceptions)
|
||||
maybeTrashObject(obj, trash)
|
||||
end
|
||||
|
||||
@ -361,15 +362,13 @@ function tidyPlayerMatCoroutine()
|
||||
mat.setVar("activeInvestigatorClass", "Neutral")
|
||||
mat.call("updateTexture")
|
||||
|
||||
for k = 1, 5 do
|
||||
coroutine.yield(0)
|
||||
end
|
||||
coWaitFrames(5)
|
||||
|
||||
-- maybe respawn tekelili cards
|
||||
if tekeliliHelper then
|
||||
tekeliliHelper.call("spawnStoredTekelili", color)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -431,3 +430,10 @@ function getOptionValue()
|
||||
return options["tidyPlayermats"]
|
||||
end
|
||||
end
|
||||
|
||||
-- pauses the current coroutine for 'frameCount' frames
|
||||
function coWaitFrames(frameCount)
|
||||
for k = 1, frameCount do
|
||||
coroutine.yield(0)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user