]> git.mxchange.org Git - flightgear.git/commitdiff
Better fix for bug #204; bind after all engines are loaded.
authorJames Turner <zakalawe@mac.com>
Sat, 1 Jan 2011 16:04:23 +0000 (16:04 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 1 Jan 2011 16:08:17 +0000 (16:08 +0000)
src/FDM/JSBSim/models/FGPropulsion.cpp

index 32d8b42a1df129d58b4b7f022b926f9d6a9107f7..57d2852f3c46c9fe9a897018e312dc3496dae9ff 100644 (file)
@@ -307,23 +307,18 @@ bool FGPropulsion::Load(Element* el)
     try {
       if (type == "piston_engine") {
         HavePistonEngine = true;
-        if (!IsBound) bind();
         Engines.push_back(new FGPiston(FDMExec, document, numEngines));
       } else if (type == "turbine_engine") {
         HaveTurbineEngine = true;
-        if (!IsBound) bind();
         Engines.push_back(new FGTurbine(FDMExec, document, numEngines));
       } else if (type == "turboprop_engine") {
         HaveTurboPropEngine = true;
-        if (!IsBound) bind();
         Engines.push_back(new FGTurboProp(FDMExec, document, numEngines));
       } else if (type == "rocket_engine") {
         HaveRocketEngine = true;
-        if (!IsBound) bind();
         Engines.push_back(new FGRocket(FDMExec, document, numEngines));
       } else if (type == "electric_engine") {
         HaveElectricEngine = true;
-        if (!IsBound) bind();
         Engines.push_back(new FGElectric(FDMExec, document, numEngines));
       } else {
         cerr << "Unknown engine type: " << type << endl;
@@ -350,6 +345,7 @@ bool FGPropulsion::Load(Element* el)
   if (el->FindElement("dump-rate"))
     DumpRate = el->FindElementValueAsNumberConvertTo("dump-rate", "LBS/MIN");
 
+  if (!IsBound) bind();
   PostLoad(el, PropertyManager);
 
   return true;