Bug #3243
Kerbals missing from the CrewRoster but referenced from ScenarioModules or Vessels break various parts of the game.
100%
Description
First off, this was a bug that was caused and worked around my DarkMultiPlayer mod, but it was suggested to report here as it's easy to both reproduce and work around and might save someone some headaches.
There's three different types of breaking I can find:
Type 1): Kerbals missing from HighLogic.CurrentGame.CrewRoster that are referenced by KerbalRescue contracts cause a throw when saving the contract, which breaks Game.SaveGame, which breaks OnGameSceneLoadRequested, which means you can't switch away from the space center (You have to alt+f4 out of the game).
To reproduce, delete the stranded kerbal out of the ROSTER{} section of persistent.sfs, or see the attached spacecenterbug.sfs file.
Type 2): Kerbals missing from HighLogic.CurrentGame.CrewRoster that are referenced by vessels cause the tracking station to break when selecting the vessel with the missing kerbal.
To reproduce, delete the assigned kerbal out of the ROSTER{} section of persistent.sfs, or see the attached trackingstation.sfs file.
Type 3): Kerbals missing from HighLogic.CurrentGame.CrewRoster that are referenced by ProgressTracking cause a throw when saving the scenario module, which breaks much like type 1 above.
This is likely a very low priority bug as it's only caused by fiddling with the persistent.sfs file, or spawning in vessels from other clients :)
DMP currently works around these bugs by spawning kerbals into the crewroster before loading the ScenarioModules or ProtoVessels, but feel free to close if you don't think this is KSP's bug to handle.
Related issues
History
#1 Updated by godarklight almost 10 years ago
As of 0.90 this bug is now 100% reproduceable in stock, all you have to do is get a kerbal that's referenced by a progress tracking node killed and then remove it at the astronaut complex - it deletes it from the CrewRoster.
Here's a 5 minute youtube video explaining the reproduction steps (starting from a new game): http://youtu.be/5uBOB31D5II
And here's the actual trace:
NullReferenceException: Object reference not set to an instance of an object
at KSPAchievements.CrewRef.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at KSPAchievements.CrewRecovery.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProgressNode.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProgressTree.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProgressTracking.OnSave (.ConfigNode node) [0x00000] in <filename unknown>:0
at ScenarioModule.Save (.ConfigNode node) [0x00000] in <filename unknown>:0
at ProtoScenarioModule..ctor (.ScenarioModule module) [0x00000] in <filename unknown>:0
at ScenarioRunner.GetUpdatedProtoModules () [0x00000] in <filename unknown>:0
at Game.Updated () [0x00000] in <filename unknown>:0
at GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode) [0x00000] in <filename unknown>:0
at SpacePlaneHangarBuilding.OnClicked () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.EnterBuilding () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding.OnLeftClick () [0x00000] in <filename unknown>:0
at SpaceCenterBuilding+
.MoveNext () [0x00000] in <filename unknown>:0
#2 Updated by Claw almost 10 years ago
- Status changed from New to Confirmed
- Severity changed from Very Low to Normal
- % Done changed from 0 to 10
Confirmed.
This is a huge problem in v0.90 because any time you fire a kerbal who has logged an achievement been rescued from a contract causes the game to lock up and the save to be unusable. With the limited number of kerbals allowed by the building upgrades, this causes an issue.
#3 Updated by Squelch over 9 years ago
- Status changed from Confirmed to Resolved
- % Done changed from 10 to 100
This problem was resolved for version 1.0.
#4 Updated by TriggerAu over 8 years ago
- Status changed from Resolved to Closed