From 54cc258cca11d525eafed590fc621bc5b691a169 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sat, 24 May 2025 17:43:08 -0300 Subject: [PATCH] improve physics --- custom_physics.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_physics.lua b/custom_physics.lua index 6a9034a..de7bc6f 100755 --- a/custom_physics.lua +++ b/custom_physics.lua @@ -81,7 +81,13 @@ function ap_airship.physics(self) self.object:set_velocity(velocity) end --minetest.chat_send_all("_baloon_buoyancy: "..self._baloon_buoyancy.." - dtime: "..self.dtime.." - ideal: "..ap_airship.ideal_step) - airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0}) + local max_y_speed = 1.5 + local curr_y_speed = vel.y + if curr_y_speed < max_y_speed then + airutils.set_acceleration(self.object,{x=0,y=y_accel,z=0}) + else + airutils.set_acceleration(self.object,{x=0,y=0,z=0}) + end end