Closed numberlesstim closed 5 months ago
I can still reproduce this bug in the latest version (v3.1.3).
Same repro steps?
Ah, so my previous fix only worked when the partManifest for the scaled down part still existed in the vesselCrewManifest. But something about this flow is resulting in the partManifest for the root part not being there. You can hit the same UpdateCrewForVessel call if you scale down a command pod so that it has no crew, then attach a fuel tank, then delete the tank. But the partManifest exists in that case and everything works. Why doesn't it exist after re-rooting?
Answer?: in on_partAttached it calls RefreshCrewAssignment if the selected part has crewcapacity > 0. So when you attach a scaled-down part, it doesn't add that part's partManifest to the vesselCrewManifest like it would have if you attached it and then scaled it down.
Seemingly confirmed:
This would all be a bit easier if parts persisted the crew capacity field. Currently there's not a great way to get the right crew capacity when creating the part manifest from the persisted config node.
This can also be done with a subassembly in place of a single pod with the same steps you provided.
Steps to reproduce:
(lower pod in image is the default size for scale)