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