Merge pull request #949 from argonui/doom-removal

Updated doom counter reset to remove ignored doom
This commit is contained in:
dscarpac 2024-11-01 18:31:10 -05:00 committed by GitHub
commit cc4ac900f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -84,9 +84,9 @@ function getDoomCount()
end
-- gets quantity (for stacks) of doom
function getDoomAmount(obj)
function getDoomAmount(obj, disregardIgnoreTag)
if (obj.is_face_down and obj.getCustomObject().image_bottom == doomURL)
and not obj.hasTag(IGNORE_TAG)
and (not obj.hasTag(IGNORE_TAG) or disregardIgnoreTag)
and inArea(obj.getPosition(), TOTAL_PLAY_AREA) then
return math.abs(obj.getQuantity())
else
@ -115,7 +115,7 @@ end
function removeDoomFromList(objList)
local count = 0
for _, obj in ipairs(objList) do
local amount = getDoomAmount(obj)
local amount = getDoomAmount(obj, true)
if amount > 0 then
TRASH.putObject(obj)
count = count + amount