countDoom() bugfix

This commit is contained in:
Chr1Z93 2023-09-30 00:40:25 +02:00
parent 947bf1dc4c
commit 9a1898ca4d

View File

@ -1,6 +1,6 @@
local playmatApi = require("playermat/PlaymatApi") local playmatApi = require("playermat/PlaymatApi")
local ZONE, TRASH local ZONE, TRASH, loopID
local doomURL = "https://i.imgur.com/EoL7yaZ.png" local doomURL = "https://i.imgur.com/EoL7yaZ.png"
local IGNORE_TAG = "DoomCounter_ignore" local IGNORE_TAG = "DoomCounter_ignore"
local COLORS = { "White", "Orange", "Green", "Red" } local COLORS = { "White", "Orange", "Green", "Red" }
@ -28,15 +28,10 @@ end
-- main function -- main function
function countDoom() function countDoom()
local doom = 0 local doom = 0
for i = 1, 5 do for i = 1, 4 do
if i = 5 then doom = doom + countDoomFromList(playmatApi.searchAroundPlaymat(COLORS[i]))
objList = ZONE.getObjects()
else
objList = playmatApi.searchAroundPlaymat(COLORS[i])
end
doom = doom + countDoomFromList(objList)
end end
doom = doom + countDoomFromList(ZONE.getObjects())
self.editButton({ index = 0, label = tostring(doom) }) self.editButton({ index = 0, label = tostring(doom) })
end end