From 4fade5839e058edff607238f6545c73deca8083c Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 16 Jun 2006 19:10:20 +0000 Subject: [PATCH] Add a flag that allows the simulator to force "radar" computations even if AI aircraft are out of range or the piloted aircraft has no radar system. These computation include range, bearing, and angular offset relative to the piloted aircraft. This gives some external script the control the behavior of the AI aircraft relative to the piloted aircraft without requiring a radar system, and without requiring the AI aircraft to be within radar range. --- src/AIModel/AIBase.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index 1b73b39e7..43a001cb9 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -266,6 +266,7 @@ void FGAIBase::unbind() { double FGAIBase::UpdateRadar(FGAIManager* manager) { double radar_range_ft2 = fgGetDouble("/instrumentation/radar/range"); + bool force_on = fgGetBool("/instrumentation/radar/debug-mode", false); radar_range_ft2 *= SG_NM_TO_METER * SG_METER_TO_FEET * 1.1; // + 10% radar_range_ft2 *= radar_range_ft2; @@ -279,7 +280,7 @@ double FGAIBase::UpdateRadar(FGAIManager* manager) // Test whether the target is within radar range. // in_range = (range_ft2 && (range_ft2 <= radar_range_ft2)); - if ( in_range ) + if ( in_range || force_on ) { props->setBoolValue("radar/in-range", true);