From 9dd7ec18894a7b4ae291a10d5e6bb7139b995dba Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Tue, 26 Nov 2019 18:50:36 +1100 Subject: [PATCH] convinced the event library to handle non-string filters --- lib/event.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/event.lua b/lib/event.lua index aecef38..7edfdc5 100644 --- a/lib/event.lua +++ b/lib/event.lua @@ -13,8 +13,12 @@ function event.pull(t,...) -- return an event, optionally with timeout *t* and f tEv = {coroutine.yield()} local ret = true for i = 1, #tA do - if not (tEv[i] or ""):match(tA[i]) then - ret = false + if type(tEv[i]) == "string" and type(tA[i]) == "string" then + if not (tEv[i] or ""):match(tA[i]) then + ret = false + end + else + ret = tEv[i] == tA[i] end end if ret then return table.unpack(tEv) end