]> git.mxchange.org Git - flightgear.git/commitdiff
Handle "double" type fields correctly for ascii input data. Previously double
authorcurt <curt>
Thu, 10 Sep 2009 18:12:33 +0000 (18:12 +0000)
committerTim Moore <timoore@redhat.com>
Sat, 12 Sep 2009 13:47:52 +0000 (15:47 +0200)
data was being down-cast to float and the loss of precision impacted data types like lon/lat positions dramatically, preventing smooth replay of data.

src/Network/generic.cxx

index b1e0c204832f2bfa71df9a4e48b74bc4417491d3..f952c1e66c4a2c2be058246e0593e3f17d8a9fc2 100644 (file)
@@ -378,9 +378,13 @@ bool FGGeneric::parse_message_ascii() {
 
         case FG_FIXED:
         case FG_FLOAT:
+            val = _in_message[i].offset + strtof(p1, 0) * _in_message[i].factor;
+            _in_message[i].prop->setFloatValue((float)val);
+            break;
+
         case FG_DOUBLE:
             val = _in_message[i].offset + strtod(p1, 0) * _in_message[i].factor;
-            _in_message[i].prop->setFloatValue((float)val);
+            _in_message[i].prop->setDoubleValue(val);
             break;
 
         default: // SG_STRING