countDoom() bugfix
This commit is contained in:
parent
947bf1dc4c
commit
9a1898ca4d
@ -1,6 +1,6 @@
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
|
||||
local ZONE, TRASH
|
||||
local ZONE, TRASH, loopID
|
||||
local doomURL = "https://i.imgur.com/EoL7yaZ.png"
|
||||
local IGNORE_TAG = "DoomCounter_ignore"
|
||||
local COLORS = { "White", "Orange", "Green", "Red" }
|
||||
@ -28,15 +28,10 @@ end
|
||||
-- main function
|
||||
function countDoom()
|
||||
local doom = 0
|
||||
for i = 1, 5 do
|
||||
if i = 5 then
|
||||
objList = ZONE.getObjects()
|
||||
else
|
||||
objList = playmatApi.searchAroundPlaymat(COLORS[i])
|
||||
end
|
||||
|
||||
doom = doom + countDoomFromList(objList)
|
||||
for i = 1, 4 do
|
||||
doom = doom + countDoomFromList(playmatApi.searchAroundPlaymat(COLORS[i]))
|
||||
end
|
||||
doom = doom + countDoomFromList(ZONE.getObjects())
|
||||
self.editButton({ index = 0, label = tostring(doom) })
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user