countDoom() bugfix
This commit is contained in:
parent
947bf1dc4c
commit
9a1898ca4d
@ -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
|
||||||
|
|
||||||
@ -69,7 +64,7 @@ function removeDoom(options)
|
|||||||
end
|
end
|
||||||
broadcastToAll(count .. " doom removed from Playermats.", "White")
|
broadcastToAll(count .. " doom removed from Playermats.", "White")
|
||||||
end
|
end
|
||||||
|
|
||||||
if options.Playarea then
|
if options.Playarea then
|
||||||
count = removeDoomFromList(ZONE.getObjects())
|
count = removeDoomFromList(ZONE.getObjects())
|
||||||
broadcastToAll(count .. " doom removed from Playerarea.", "White")
|
broadcastToAll(count .. " doom removed from Playerarea.", "White")
|
||||||
|
Loading…
Reference in New Issue
Block a user