don't blindly overwrite user settings -- only initialize if necessary
This commit is contained in:
parent
cd4b05909d
commit
8c1b1f50a5
1 changed files with 10 additions and 8 deletions
|
@ -63,8 +63,7 @@ FGMarkerBeacon::FGMarkerBeacon(SGPropertyNode *node) :
|
|||
low_tbl = new SGInterpTable( low.str() );
|
||||
high_tbl = new SGInterpTable( high.str() );
|
||||
|
||||
int i;
|
||||
for ( i = 0; i < node->nChildren(); ++i ) {
|
||||
for ( int i = 0; i < node->nChildren(); ++i ) {
|
||||
SGPropertyNode *child = node->getChild(i);
|
||||
string cname = child->getName();
|
||||
string cval = child->getStringValue();
|
||||
|
@ -110,8 +109,11 @@ FGMarkerBeacon::init ()
|
|||
audio_vol = node->getChild("volume", 0, true);
|
||||
serviceable = node->getChild("serviceable", 0, true);
|
||||
|
||||
if (power_btn->getType() == SGPropertyNode::NONE)
|
||||
power_btn->setBoolValue( true );
|
||||
if (audio_btn->getType() == SGPropertyNode::NONE)
|
||||
audio_btn->setBoolValue( true );
|
||||
if (serviceable->getType() == SGPropertyNode::NONE)
|
||||
serviceable->setBoolValue( true );
|
||||
|
||||
morse.init();
|
||||
|
|
Loading…
Add table
Reference in a new issue