From 73aa232731118044240423041f6712a58cbcce30 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sun, 4 Feb 2024 10:31:30 -0300 Subject: [PATCH] fix lag when climbing --- control.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/control.lua b/control.lua index 8d81b3d..7ff47cd 100755 --- a/control.lua +++ b/control.lua @@ -192,8 +192,10 @@ function ap_airship.buoyancy_auto_correction(self, dtime) --minetest.chat_send_player(self.driver_name, "antes: " .. self._baloon_buoyancy) if self._baloon_buoyancy > 0 then factor = -1 end local time_correction = (dtime/ap_airship.ideal_step) + if time_correction < 1 then time_correction = 1 end local intensity = 0.001 local correction = (intensity*factor) * time_correction + if math.abs(correction) > 0.005 then correction = 0.005 * math.sign(correction) end --minetest.chat_send_player(self.driver_name, correction) local before_correction = self._baloon_buoyancy local new_baloon_buoyancy = self._baloon_buoyancy + correction