From 8290fbb8d2ba4ea8a18da89438d087fd3b26d575 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 8 Sep 2019 12:57:13 +0200 Subject: [PATCH] improvement(actors): use the new timers modules --- gamecore/modules/world/actors/baseactor.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gamecore/modules/world/actors/baseactor.lua b/gamecore/modules/world/actors/baseactor.lua index 4033f0b..f034895 100644 --- a/gamecore/modules/world/actors/baseactor.lua +++ b/gamecore/modules/world/actors/baseactor.lua @@ -229,17 +229,16 @@ end -- Control the integrated timers of the actor function BaseActor:initTimers() - self.timers = {} + self.timers = core.modules.Timers(self) end function BaseActor:addTimer(name, t) - self.timers[name] = Timer(self, name, t) + core.debug:warning("actor", "function actor:addTimer is deprecated, prefer actor.timers:newTimer") + self.timers:newTimer(t, name) end function BaseActor:updateTimers(dt) - for k,v in pairs(self.timers) do - v:update(dt) - end + self.timers:update(dt) end function BaseActor:timerResponse(name)