From 136e16fe21ddb5e69940e4b0c88b709b553ea808 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Thu, 22 Feb 2024 21:19:51 -0300 Subject: [PATCH] fix for backwards acceleration --- lib_copter/control.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_copter/control.lua b/lib_copter/control.lua index 447c5c1..cb434fc 100755 --- a/lib_copter/control.lua +++ b/lib_copter/control.lua @@ -125,6 +125,7 @@ function airutils.heli_control(self, dtime, hull_direction, longit_speed, longit self._acceleration = 0 end self._acceleration = math.min(self._acceleration,self._max_engine_acc) + self._acceleration = math.max(self._acceleration,-1) if is_flying then --why double check? because I dont want lateral movement when landed if ctrl.right then @@ -152,6 +153,7 @@ function airutils.heli_control(self, dtime, hull_direction, longit_speed, longit end self._vehicle_acc = math.min(self._acceleration, self._max_engine_acc) + self._vehicle_acc = math.max(self._acceleration,-1) self._lat_acc = math.min(self._lat_acceleration, self._max_engine_acc) local hull_acc = vector.multiply(hull_direction,self._vehicle_acc)