Permalink
Browse files

Fixed timers on GMod13. Varargs were removed.

  • Loading branch information...
1 parent fe4070c commit 01eddb06708c6938f4254b34e754c903d46dc8f9 @Ninja101 Ninja101 committed Jul 21, 2012
@@ -40,6 +40,8 @@ local function Expression2TickClock()
tickrun = 0
end
hook.Add("Think", "Expression2TickClock", Expression2TickClock)
-timer.Create("Expression2TickClock", 5, 0, hook.Add, "Think", "Expression2TickClock", Expression2TickClock)
+timer.Create("Expression2TickClock", 5, 0, function()
+ hook.Add("Think", "Expression2TickClock", Expression2TickClock)
+end)
__e2setcost(nil)
@@ -25,10 +25,14 @@ local function AddTimer(self, name, delay)
if delay < 10 then delay = 10 end
if runner == name then
- timer.Adjust("e2_" .. self.data['timer'].timerid .. "_" .. name, delay/1000, 1, Execute, self, name)
+ timer.Adjust("e2_" .. self.data['timer'].timerid .. "_" .. name, delay/1000, 1, function()
+ Execute(self, name)
+ end)
timer.Start("e2_" .. self.data['timer'].timerid .. "_" .. name)
elseif !self.data['timer'].timers[name] then
- timer.Create("e2_" .. self.data['timer'].timerid .. "_" .. name, delay/1000, 1, Execute, self, name)
+ timer.Create("e2_" .. self.data['timer'].timerid .. "_" .. name, delay/1000, 1, function()
+ Execute(self, name)
+ end)
end
self.data['timer'].timers[name] = true

0 comments on commit 01eddb0

Please sign in to comment.