Hi Harald, Harald JOHNSEN wrote:
> This lines only initialize the internal values of the electrical system. > The properties are set in the propagate function : > // publish values to specified properties > for ( i = 0; i < node->get_num_props(); ++i ) { > fgSetFloat( node->get_prop(i).c_str(), node->get_volts() ); > } > But this is only done if : > // if this node has found a stronger power source, update the > // value and propagate to all children > if ( volts > node->get_volts() ) { > node->set_volts( volts ); > > So with the power switches off we have volts == 0 and we never enter the > if statement and the properies stay with their old content. I still don't understand why it should be required to initialize these values to -0.01 instead of 0.0. If power switches are off, then 0.0 is the correct value "by definition" (TM). If some conditional statement doesn't handle this, then probably the conditional should be work differently instead initializing some valued with, well, 'irritating' values. Certainly, one year later someone writes a different routine and expects the voltage to be 0.0 if the switches are off .... and would be terribly annoyed if he had to deal with this workaround. Cheers, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -------------------------------------------------------------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel