}
if (PropertyManager->HasNode(tmp)) {
+ FGPropertyNode* property = PropertyManager->GetNode(tmp);
+ if (property->isTied()) {
cout << "Property " << tmp << " has already been successfully bound (late)." << endl;
- } else {
- PropertyManager->Tie( tmp, this, &FGFunction::GetValue);
}
-
+ }
+ PropertyManager->Tie( tmp, this, &FGFunction::GetValue);
}
}
outfile.close();
break;
default:
- throw("When writing a state file, the supplied value must be 1 or 2 for the version number of teh resulting IC file");
+ return; // Ignore other writes to the property, e.g. on FlightGear reset.
+ throw("When writing a state file, the supplied value must be 1 or 2 for the version number of the resulting IC file");
}
} else {
cerr << "Could not open and/or write the state to the initial conditions file: " << filename << endl;