From 055c6242f6d3c76a4930db51ae7bf104dbb0a8a4 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Sat, 28 Dec 2024 08:27:45 -0600 Subject: [PATCH] ArduPlane:bug fix --- ArduPlane/takeoff.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArduPlane/takeoff.cpp b/ArduPlane/takeoff.cpp index 3f18b405ae..740daeaf05 100644 --- a/ArduPlane/takeoff.cpp +++ b/ArduPlane/takeoff.cpp @@ -25,11 +25,13 @@ bool Plane::auto_takeoff_check(void) // Reset states if process has been interrupted, except initial_direction.initialized if set #if MODE_AUTOLAND_ENABLED bool takeoff_dir_initialized = takeoff_state.initial_direction.initialized; + float takeoff_dir = takeoff_state.initial_direction.heading; #endif if (takeoff_state.last_check_ms && (now - takeoff_state.last_check_ms) > 200) { memset(&takeoff_state, 0, sizeof(takeoff_state)); #if MODE_AUTOLAND_ENABLED takeoff_state.initial_direction.initialized = takeoff_dir_initialized; //restore dir init state + takeoff_state.initial_direction.heading = takeoff_dir; #endif return false; }