i derped, event.handlers and things

This commit is contained in:
payonel 2017-11-27 12:11:16 -08:00
parent 89b2ff19cb
commit e6efd30ecc

View File

@ -40,8 +40,8 @@ end
function event.cancel(timerId)
checkArg(1, timerId, "number")
if handlers[timerId] then
handlers[timerId] = nil
if event.handlers[timerId] then
event.handlers[timerId] = nil
return true
end
return false
@ -50,9 +50,9 @@ end
function event.ignore(name, callback)
checkArg(1, name, "string")
checkArg(2, callback, "function")
for id, handler in pairs(handlers) do
for id, handler in pairs(event.handlers) do
if handler.key == name and handler.callback == callback then
handlers[id] = nil
event.handlers[id] = nil
return true
end
end