From 769dd7fe7bfd8290148b3aeb3e8cd366183a8167 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 3 Jul 2017 18:38:18 -0400 Subject: Adjust rate control code to work better now it'll run at full speed if there's enough time else it'll throttle back to 1/3. (at that point, the movement imprecision caused by this will become hidden behind lag-induced imprecision) --- luaentity.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'luaentity.lua') diff --git a/luaentity.lua b/luaentity.lua index 382b0c1..34b6665 100644 --- a/luaentity.lua +++ b/luaentity.lua @@ -362,13 +362,12 @@ local move_entities_globalstep_part2 = function(dtime) end end -local handle_active_blocks_step = 0.2 local handle_active_blocks_timer = 0.1 minetest.register_globalstep(function(dtime) handle_active_blocks_timer = handle_active_blocks_timer + dtime - if handle_active_blocks_timer >= handle_active_blocks_step then - handle_active_blocks_timer = handle_active_blocks_timer - handle_active_blocks_step + if dtime < 0.2 or handle_active_blocks_timer >= (dtime * 3) then + handle_active_blocks_timer = 0.1 move_entities_globalstep_part1(dtime) move_entities_globalstep_part2(dtime) end -- cgit v1.2.3