From 2959abc4f6cad6c3589d62819305bf0a7cc60a84 Mon Sep 17 00:00:00 2001 From: Lorenzo Cogotti Date: Thu, 1 Jun 2023 22:46:39 +0200 Subject: [PATCH] [timer] Rework new() consistently with other classes. --- timer.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/timer.lua b/timer.lua index 663c196..823433e 100644 --- a/timer.lua +++ b/timer.lua @@ -194,8 +194,11 @@ __index = function(tweens, key) end}) -- Timer instancing -function Timer.new() - return setmetatable({functions = {}, tween = Timer.tween}, Timer) +function Timer:new(args) + self = setmetatable(args or {}, self) + self.functions = {} + + return self end return Timer