Quoting Harald JOHNSEN <[EMAIL PROTECTED]>: > Martin Spott wrote: > > >Hi Harald, > > > > > > > >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. > > > > > The statment should be if ( volts > node->get_volts() || > !node->is_initialized) but I don't find that simpler or easier to read. > > >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. > > > > > But the whole point of this patch is to have *0.0* volts. We do not have > 0.0 volts today, we have 24 volts. > > Harald. > >
Hi, I solved this problem with this condition: if ( volts > node->get_volts() || node->get_volts()==0 ) I know, it's not the best, but it works (I think much more better than 24 volts everywhere and useless switches). The correct solution is to fill the internal structures first, and then copy all values to properties, but it is not as easy as replace the "if" condition. ;-) -- //\ | Javky |||_< >--\_||_ _/ \_/\_ / P R A G A \ mater urbium ------------------------------------------------------------------------- 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