Feedback #16089
PartModule does not save UPGRADESAPPLIED during .OnSave .
Description
I have a class called "HeavyHelixSampleStorage" that inherits PartModule. My class has a KSPField named "MyValue". During .OnSave I call the inherited .OnSave from PartModule. The inherited .OnSave adds 'name', 'isEnabled', 'MyValue', 'stagingEnabled', 'EVENTS' and 'ACTIONS' to the ConfigNode, but it does not add 'UPGRADESAPPLIED'.
The 'UPGRADESAPPLIED' subnode is added later, but it seems weird that it behaves differently from the other ConfigNode content.
History
#1 Updated by Rodhern about 7 years ago
JPLRepo has answered on the forum (https://forum.kerbalspaceprogram.com/index.php?/topic/166271-part-confignode-persistence-of-upgradesapplied/&do=findComment&comment=3191878).
Turns out that there are some technical aspects of the upgrade system that necessitate that 'UPGRADESAPPLIED' nodes are added at a later stage than when PartModule.OnSave execute.
#2 Updated by Squelch about 7 years ago
- Status changed from New to Updated
UPGRADESAPPLIED is a flag that signifies that the part has had the defined confignodes saved for that part. My understanding is that this flag is only set on a save after the confignodes have been loaded, not at the time they are written. I hope this answers your question?
Please refer to the API documentation for PartModule for further information.
#3 Updated by Squelch about 7 years ago
Seems we crossed. Thanks for the update.
#4 Updated by Squelch about 7 years ago
- Status changed from Updated to Closed
I believe a solution has been offered on the forums for this feedback, and the matter can be closed.