Fix timer initialization.
authorAuke Kok <sofar@foo-projects.org>
Tue, 19 Apr 2016 22:47:14 +0000 (15:47 -0700)
committerparamat <mat.gregory@virginmedia.com>
Thu, 21 Apr 2016 09:14:59 +0000 (10:14 +0100)
This fixes the problem that the first timer tick is an
overrun and causes all timers to expire immediately.

replaces #4003

builtin/game/misc.lua

index 4f58710d0a4cce469923b45504e29bb78c8c5682..de41cfc91161a44a10fdbbb69710db342a38bc79 100644 (file)
@@ -6,7 +6,7 @@
 
 local jobs = {}
 local time = 0.0
-local last = 0.0
+local last = core.get_us_time() / 1000000
 
 core.register_globalstep(function(dtime)
        local new = core.get_us_time() / 1000000