]> git.mxchange.org Git - flightgear.git/commitdiff
Fix minor DME frequency issue.
authorThorstenB <brehmt@gmail.com>
Sun, 10 Jul 2011 10:52:45 +0000 (12:52 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 10 Jul 2011 10:52:45 +0000 (12:52 +0200)
DME frequency value should be double - not string.

src/Main/options.cxx

index ff306e6d9fe63018b11c7a56e04078947f3362bf..9e1b5c55b4aa85e73f67f9e6fb4183cc82becf62 100644 (file)
@@ -1132,10 +1132,16 @@ fgOptDME( const char *arg )
         fgSetString("/instrumentation/dme/frequencies/source",
                     "/instrumentation/nav[1]/frequencies/selected-mhz");
     } else {
+        double frequency = atof(arg);
+        if (frequency==0.0)
+        {
+            SG_LOG(SG_INPUT, SG_ALERT, "Invalid DME frequency: '" << arg << "'.");
+            return FG_OPTIONS_ERROR;
+        }
         fgSetInt("/instrumentation/dme/switch-position", 2);
         fgSetString("/instrumentation/dme/frequencies/source",
                     "/instrumentation/dme/frequencies/selected-mhz");
-        fgSetString("/instrumentation/dme/frequencies/selected-mhz", arg);
+        fgSetDouble("/instrumentation/dme/frequencies/selected-mhz", frequency);
     }
     return FG_OPTIONS_OK;
 }