Merge pull request #949 from argonui/doom-removal
Updated doom counter reset to remove ignored doom
This commit is contained in:
commit
cc4ac900f2
@ -84,9 +84,9 @@ function getDoomCount()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- gets quantity (for stacks) of doom
|
-- gets quantity (for stacks) of doom
|
||||||
function getDoomAmount(obj)
|
function getDoomAmount(obj, disregardIgnoreTag)
|
||||||
if (obj.is_face_down and obj.getCustomObject().image_bottom == doomURL)
|
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
|
and inArea(obj.getPosition(), TOTAL_PLAY_AREA) then
|
||||||
return math.abs(obj.getQuantity())
|
return math.abs(obj.getQuantity())
|
||||||
else
|
else
|
||||||
@ -115,7 +115,7 @@ end
|
|||||||
function removeDoomFromList(objList)
|
function removeDoomFromList(objList)
|
||||||
local count = 0
|
local count = 0
|
||||||
for _, obj in ipairs(objList) do
|
for _, obj in ipairs(objList) do
|
||||||
local amount = getDoomAmount(obj)
|
local amount = getDoomAmount(obj, true)
|
||||||
if amount > 0 then
|
if amount > 0 then
|
||||||
TRASH.putObject(obj)
|
TRASH.putObject(obj)
|
||||||
count = count + amount
|
count = count + amount
|
||||||
|
Loading…
Reference in New Issue
Block a user