Merge pull request #450 from argonui/clean-up-helper

Clean Up Helper: removed falsely merged code
This commit is contained in:
Chr1Z 2023-10-30 16:15:45 +01:00 committed by GitHub
commit cfa50bb4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,7 +251,9 @@ function tidyPlayareaCoroutine()
else else
for _, obj in ipairs(playAreaZone.getObjects()) do for _, obj in ipairs(playAreaZone.getObjects()) do
-- ignore these elements -- ignore these elements
if obj.hasTag(IGNORE_TAG) == false and checkMemo(obj) == false then if obj.hasTag(IGNORE_TAG) == false
and obj.locked == false
and obj.interactable == true then
coroutine.yield(0) coroutine.yield(0)
trash.putObject(obj) trash.putObject(obj)
end end
@ -288,14 +290,15 @@ function tidyPlayerMatCoroutine()
for _, obj in ipairs(objList) do for _, obj in ipairs(objList) do
-- ignore these elements -- ignore these elements
if obj.hasTag(IGNORE_TAG) == false if obj.hasTag(IGNORE_TAG) == false
and obj.hasTag("ActionToken") == false and obj.getDescription() ~= "Action Token"
and obj.hasTag("chaosBag") == false and obj.hasTag("chaosBag") == false
and checkMemo(obj) == false then and obj.locked == false
and obj.interactable == true then
coroutine.yield(0) coroutine.yield(0)
trash.putObject(obj) trash.putObject(obj)
-- flip action tokens back to ready -- flip action tokens back to ready
elseif obj.hasTag("ActionToken") == false and obj.is_face_down then elseif obj.getDescription() == "Action Token" and obj.is_face_down then
obj.flip() obj.flip()
end end
end end
@ -341,15 +344,3 @@ function searchMythosArea()
end end
return objList return objList
end end
-- checks if the object is owned by a playermat or the mythos, returns boolean
function checkMemo(obj)
local memo = obj.getMemo()
if memo then
local decoded = JSON.decode(memo) or {}
if decoded.matColor then
return true
end
end
return false
end