Better fix for bug #204; bind after all engines are loaded.
This commit is contained in:
parent
738d653745
commit
d4d70200eb
1 changed files with 1 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue