From fdc1a2ba54b8436b8451aa78bdf7de31f7f28565 Mon Sep 17 00:00:00 2001 From: durk Date: Tue, 10 Jul 2007 07:01:54 +0000 Subject: [PATCH] Bugfixes: 1) Fix the if (next) setLeadDistance bug (reported by Csaba Halaszi /helijah) 2) Decrease AI aircraft Heading error tolerance to 1% of its original value. This is necessary to mitigate spinning and makes for actual "on-runway" landings. --- src/AIModel/AIAircraft.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 897801b02..411b236c6 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -705,7 +705,7 @@ void FGAIAircraft::controlHeading(FGAIFlightPlan::waypoint* curr) { if (finite(calc_bearing)) { double hdg_error = calc_bearing - tgt_heading; - if (fabs(hdg_error) > 1.0) { + if (fabs(hdg_error) > 0.01) { TurnTo( calc_bearing ); } @@ -732,7 +732,9 @@ void FGAIAircraft::controlSpeed(FGAIFlightPlan::waypoint* curr, FGAIFlightPlan:: if (fabs(speed_diff) > 10) { prevSpeed = speed; - fp->setLeadDistance(speed, tgt_heading, curr, next); + if (next) { + fp->setLeadDistance(speed, tgt_heading, curr, next); + } } } -- 2.39.5