From 22fe14989073ac9d04b3f7be6fe0f25d2f6f27d8 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sat, 8 Jul 2023 17:08:15 -0300 Subject: [PATCH] more fixed from abs --- init.lua | 2 +- lib_planes/control.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 31ce307..a0058ad 100644 --- a/init.lua +++ b/init.lua @@ -291,7 +291,7 @@ function airutils.getLiftAccel(self, velocity, accel, longit_speed, roll, curr_p local cross = vector.cross(velocity,hdir) local lift_dir = vector.normalize(vector.cross(cross,hdir)) - local lift_coefficient = (0.24*abs(daoa)*(1/(0.025*daoa+3))^4*math.sign(daoa)) + local lift_coefficient = (0.24*math.abs(daoa)*(1/(0.025*daoa+3))^4*math.sign(daoa)) local lift_val = math.abs((lift*(vector.length(striped_velocity)^2)*lift_coefficient)*curr_percent_height) if lift_val < 1 then lift_val = 1 end -- hipotetical aerodinamic wing will have no "lift" for down --minetest.chat_send_all('lift: '.. lift_val) diff --git a/lib_planes/control.lua b/lib_planes/control.lua index 627e8e0..fd2e6f4 100755 --- a/lib_planes/control.lua +++ b/lib_planes/control.lua @@ -83,7 +83,7 @@ function airutils.control(self, dtime, hull_direction, longit_speed, longit_drag engineacc = longit_speed * -1 end end - if abs(longit_speed) < 0.2 then + if math.abs(longit_speed) < 0.2 then stop = true end end