]> git.mxchange.org Git - flightgear.git/blobdiff - src/MultiPlayer/mpmessages.hxx
AircraftModel hacking for package support.
[flightgear.git] / src / MultiPlayer / mpmessages.hxx
index 2499da2cfac3a30de22a7f7bdbfee77537b90f2b..38e7fea58a524e096e262a875b18d176af111ce0 100644 (file)
@@ -37,7 +37,6 @@
 
 #include <vector>
 
-#include <plib/sg.h>
 #include <simgear/compiler.h>
 #include <simgear/props/props.hxx>
 #include <simgear/math/SGMath.hxx>
@@ -120,7 +119,7 @@ struct FGPropertyData {
   unsigned id;
   
   // While the type isn't transmitted, it is needed for the destructor
-  SGPropertyNode::Type type;
+  simgear::props::Type type;
   union { 
     int int_value;
     float float_value;
@@ -128,7 +127,7 @@ struct FGPropertyData {
   }; 
   
   ~FGPropertyData() {
-    if ((type == SGPropertyNode::STRING) || (type == SGPropertyNode::UNSPECIFIED))
+    if ((type == simgear::props::STRING) || (type == simgear::props::UNSPECIFIED))
     {
       delete [] string_value;
     }
@@ -142,7 +141,7 @@ struct FGExternalMotionData {
   // simulation time when this packet was generated
   double time;
   // the artificial lag the client should stay behind the average
-  // simulation time to arrival time diference
+  // simulation time to arrival time difference
   // FIXME: should be some 'per model' instead of 'per packet' property
   double lag;
   
@@ -165,8 +164,22 @@ struct FGExternalMotionData {
   // the earth centered frame
   SGVec3f angularAccel;
   
-  // The set of properties recieved for this timeslot
+  // The set of properties received for this timeslot
   std::vector<FGPropertyData*> properties;
+
+  ~FGExternalMotionData()
+  {
+      std::vector<FGPropertyData*>::const_iterator propIt;
+      std::vector<FGPropertyData*>::const_iterator propItEnd;
+      propIt = properties.begin();
+      propItEnd = properties.end();
+
+      while (propIt != propItEnd)
+      {
+        delete *propIt;
+        propIt++;
+      }
+  }
 };
 
 #endif