]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIScenario.cxx
Set the format default to float instead of int.
[flightgear.git] / src / AIModel / AIScenario.cxx
index e92f04da30bc766871b8c27d568f781e9e32db47..9742db92c340f2d4dea1bea9a4e676f3cef45ca8 100644 (file)
@@ -34,7 +34,7 @@
 
 
 
-FGAIScenario::FGAIScenario(string filename)
+FGAIScenario::FGAIScenario(string &filename)
 {
   int i;
   SGPath path( globals->get_fg_root() );
@@ -54,9 +54,9 @@ FGAIScenario::FGAIScenario(string filename)
   SGPropertyNode * node = root.getNode("scenario");
   for (i = 0; i < node->nChildren(); i++) { 
      //cout << "Reading entry " << i << endl;        
-     FGAIModelEntity* en = new FGAIModelEntity;
-     entries.push_back( en );
      SGPropertyNode * entry_node = node->getChild(i);
+
+     FGAIModelEntity* en = new FGAIModelEntity;
      en->callsign       = entry_node->getStringValue("callsign", "none");
      en->m_type         = entry_node->getStringValue("type", "aircraft");
      en->m_class        = entry_node->getStringValue("class", "jet_transport");
@@ -81,12 +81,14 @@ FGAIScenario::FGAIScenario(string filename)
      en->wind_from_north = entry_node->getDoubleValue("wind_from_north", 0);
      en->wind            = entry_node->getBoolValue("wind", false);
      en->cd              = entry_node->getDoubleValue  ("cd", 0.029); 
-     en->weight          = entry_node->getDoubleValue  ("weight", 0.030); 
+     en->mass            = entry_node->getDoubleValue  ("mass", 0.007); 
+
 
      en->fp             = NULL;
      if (en->flightplan != ""){
         en->fp = new FGAIFlightPlan( en->flightplan );
      }
+     entries.push_back( en );
    }
 
   entry_iterator = entries.begin();
@@ -117,3 +119,4 @@ int FGAIScenario::nEntries( void )
 }
 
 // end scenario.cxx
+