Stop LuaControllers from overheating (fixes #1)

This commit is contained in:
Lars Müller 2021-08-15 12:25:03 +02:00 committed by GitHub
commit e6c7c75a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,14 +33,13 @@ local function get_gametime_init(dtime)
end end
for index, globalstep in pairs(minetest.registered_globalsteps) do for index, globalstep in pairs(minetest.registered_globalsteps) do
if globalstep == get_gametime_init then if globalstep == get_gametime_init then
table.remove(minetest.registered_globalsteps, index) -- globalsteps of mods which depend on modlib will execute after this
minetest.registered_globalsteps[index] = function(dtime)
gametime = gametime + dtime
end
break break
end end
end end
-- globalsteps of mods which depend on modlib will execute after this
minetest.register_globalstep(function(dtime)
gametime = gametime + dtime
end)
end end
minetest.register_globalstep(get_gametime_init) minetest.register_globalstep(get_gametime_init)