...needed to forward-declare for the previous fix

This commit is contained in:
Max Cahill 2022-11-08 09:23:45 +11:00
parent c6e6ec858c
commit 844c9e8c8f

View File

@ -97,8 +97,9 @@ end
--subscribe to an event, automatically unsubscribe once called --subscribe to an event, automatically unsubscribe once called
function pubsub:subscribe_once(event, callback) function pubsub:subscribe_once(event, callback)
local f
local called = false local called = false
local f = function(...) f = function(...)
if not called then if not called then
callback(...) callback(...)
self:unsubscribe(event, f) self:unsubscribe(event, f)