Complicated workaround dated from dgII .... Did you searched in SDK perhaps there is a new parameters "don't refuel on ground?"
...searched just yet, seem not, well, let start...
how it work:
We keep always a save of our current level in tank, if on ground tank level
increase in a strange manner it's because "someone" (orbiter refuel)
changed them so we set back our tank with saved value.
First we need a set of value in our class:
double dMainPropellantMass;
double dOldMainPropellantMass;
double dRcsPropellantMass;
double dOldRcsPropellantMass;
BOOL FirstTimeStepInitDonein setclassclap initialise your value NOTE: ***Always*** initialise your value in setclasscap even if you think
it's useless you'll thanks me when you'll have several thousand lines. By intitialising *all* values you take a good
habit and ensure you'll never forget one wich is an uggly cause of misterious bugs.. Anyway it's a very bad programming habit to let value undefined at start of sim (or any prog for what it matter).
I use structure to keep my vessel data hence the "Data."
Data.dMainPropellantMass=0;
Data.dOldMainPropellantMass=0;
Data.dRcsPropellantMass=0;
Data.dOldRcsPropellantMass=0;
FirstTimeStepInitDone=FALSENow all in timestep at the very start ,( I'll put an image of next step because it look more clear,
this prevent you to copy/past but at least you'll understand better how it work)
Now about questions:Why "+10.0f" ?: because we can refuel ourself the tank, we don't want that workaround function detect that
and we don't care if we have a difference of 9kg in the rare case if the tank was 9kg below full,
nobody will detect that difference.
Why don't you test RCS level?: probably RCS full while main tank empty is a *very* rare case, never had a
bug report about that (but you can do it if you want) and I optimize every line of code I can (the test run every
frame below 50 meters)
![;)](http://orbiter.dansteph.com/forum/Smileys/orbitersmiley/smilie3.gif)
Hope it help ?
Dan
Message modifié ( 10-01-2007 03:07 )