]> git.mxchange.org Git - flightgear.git/commitdiff
Radar patch from Vivian
authorTim Moore <timoore@redhat.com>
Sat, 11 Jul 2009 23:02:58 +0000 (01:02 +0200)
committerTim Moore <timoore@redhat.com>
Sat, 11 Jul 2009 23:02:58 +0000 (01:02 +0200)
src/AIModel/AIBase.cxx

index 973d4b69ecda3e397572d5910a5624613d51b617..a63751a1c9e0560f319cb4e8ab7211201996b864 100644 (file)
@@ -318,9 +318,16 @@ void FGAIBase::unbind() {
     props->untie("radar/ht-diff-ft");
 
     props->untie("controls/lighting/nav-lights");
+
+    props->setBoolValue("/sim/controls/radar/", true);
+
 }
 
 double FGAIBase::UpdateRadar(FGAIManager* manager) {
+    bool control = fgGetBool("/sim/controls/radar", true);
+
+    if(!control) return 0;
+
     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%