From 3f7fda7079b5655fccfd392399d1ff9aebd1a943 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 22 Sep 2011 15:48:56 +0100 Subject: util.timer: Fix corner case of timer not repeating if it returns <= 0 --- util/timer.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/timer.lua b/util/timer.lua index 3061da72..642d6e36 100644 --- a/util/timer.lua +++ b/util/timer.lua @@ -32,7 +32,10 @@ if not event then if delay >= current_time then t_insert(new_data, {delay, func}); else - func(); + local r = func(); + if r and type(r) == "number" then + return _add_task(r, func); + end end end -- cgit v1.2.3