SSTU - Shadow Space Technologies Unlimited

SSTU - Shadow Space Technologies Unlimited

98.5k Downloads

VolumeContainer-default values persist after part reload; defaults not zeroed out properly on part.load

RedParadize opened this issue ยท 3 comments

commented

Fuel tank that have non LFO content have its cost and mass reverted to

To reproduce the bug:
Create a tank
change content
save
reload

Edit:
My diagnostic was wrong. Looks like LFO fuel is added on top of existing value after reload.

commented

Hmm.. strange. Which tank(s) are exhibiting this?

And is it changing the resources in the part, or merely displaying the mass/cost incorrectly?

commented

All tanks have the issues. Sorry the title is misleading, I figured out the real issue afterwards. A more accurate description would be that after reload, LFO settings are applied on top of the saved settings.

Example:

1: Create a tank (any tank)
2: Switch content to battery (or anything else)
Now, the content window show 1 for electric charge and 0 for everything else.
3: Save and reload.
Now, the content window shot 1 for electric charge, 9 for fuel and 11 for oxidizer.

commented

Ahh.. noted; should be easy enough to fix.

Previously I was storing and reloading the ratio for -every single resource-. But I changed that to only save and load ratios for resources with ratio >0; however I did not add in code to zero out the ratios prior to reload, so whatever is being loaded would merely -add to- any other default resoruces for the part.

Will be simple enough to fix by zeroing out any existing ratios when load() is called. Will be fixed and available with the next update/release.