AC_Fence: fix autofence enable in takeoff mode

This commit is contained in:
Henry Wurzburg 2023-12-19 13:42:24 -06:00 committed by Andrew Tridgell
parent aaad98e898
commit dfc1b84186

View File

@ -205,6 +205,9 @@ void AC_Fence::disable_floor()
*/ */
void AC_Fence::auto_enable_fence_after_takeoff(void) void AC_Fence::auto_enable_fence_after_takeoff(void)
{ {
if (_enabled) {
return;
}
switch(auto_enabled()) { switch(auto_enabled()) {
case AC_Fence::AutoEnable::ALWAYS_ENABLED: case AC_Fence::AutoEnable::ALWAYS_ENABLED:
case AC_Fence::AutoEnable::ENABLE_DISABLE_FLOOR_ONLY: case AC_Fence::AutoEnable::ENABLE_DISABLE_FLOOR_ONLY: