diff --git a/src/accessories/CleanUpHelper.ttslua b/src/accessories/CleanUpHelper.ttslua index 8fef10e5..05a52741 100644 --- a/src/accessories/CleanUpHelper.ttslua +++ b/src/accessories/CleanUpHelper.ttslua @@ -251,7 +251,9 @@ function tidyPlayareaCoroutine() else for _, obj in ipairs(playAreaZone.getObjects()) do -- 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) trash.putObject(obj) end @@ -288,14 +290,15 @@ function tidyPlayerMatCoroutine() for _, obj in ipairs(objList) do -- ignore these elements if obj.hasTag(IGNORE_TAG) == false - and obj.hasTag("ActionToken") == false + and obj.getDescription() ~= "Action Token" and obj.hasTag("chaosBag") == false - and checkMemo(obj) == false then + and obj.locked == false + and obj.interactable == true then coroutine.yield(0) trash.putObject(obj) -- 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() end end @@ -341,15 +344,3 @@ function searchMythosArea() end return objList 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