]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/common/async_event.lua
Small tweaking (alignement - client tab)
[minetest.git] / builtin / common / async_event.lua
index ef4bf4354401f9a617274343b879b1ad544008b2..988af79b95377341f7463cc641bd1b7b5e435e74 100644 (file)
@@ -1,6 +1,4 @@
 
-local core = engine or minetest
-
 core.async_jobs = {}
 
 local function handle_job(jobid, serialized_retval)
@@ -10,14 +8,14 @@ local function handle_job(jobid, serialized_retval)
        core.async_jobs[jobid] = nil
 end
 
-if engine ~= nil then
-       core.async_event_handler = handle_job
-else
-       minetest.register_globalstep(function(dtime)
+if core.register_globalstep then
+       core.register_globalstep(function(dtime)
                for i, job in ipairs(core.get_finished_jobs()) do
                        handle_job(job.jobid, job.retval)
                end
        end)
+else
+       core.async_event_handler = handle_job
 end
 
 function core.handle_async(func, parameter, callback)