additional memo check for CUH
This commit is contained in:
parent
4c0c025319
commit
aafc145495
@ -279,7 +279,7 @@ 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 then
|
if obj.hasTag(IGNORE_TAG) == false and checkMemo(obj) == false then
|
||||||
coroutine.yield(0)
|
coroutine.yield(0)
|
||||||
trash.putObject(obj)
|
trash.putObject(obj)
|
||||||
end
|
end
|
||||||
@ -312,7 +312,8 @@ function tidyPlayerMatCoroutine()
|
|||||||
-- 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.hasTag("ActionToken") == false
|
||||||
and obj.hasTag("chaosBag") == false then
|
and obj.hasTag("chaosBag") == false
|
||||||
|
and checkMemo(obj) == false then
|
||||||
coroutine.yield(0)
|
coroutine.yield(0)
|
||||||
trash.putObject(obj)
|
trash.putObject(obj)
|
||||||
|
|
||||||
@ -357,3 +358,15 @@ function findObjects(num)
|
|||||||
debug = false
|
debug = false
|
||||||
})
|
})
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user