Fix vehicle parts being unrepairable after removing from vehicle #79391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Fix vehicle parts being unrepairable after removing from vehicle"
Purpose of change
Repairable damaged vehicle parts, when removed from their respective vehicle, can no longer be repaired.
They can't be repaired neither as an item nor when installed into a (same or different) vehicle.
Doesn't seem like this is intended behavior to me, but idunno.
Fixes #74035
Describe the solution
Just applying the changes I found in #69696; the work is @lispcoc's. All I've done is the testing.
The contributor closed the PR due to not having time to test it, and hasn't followed up since. If they or anyone wants to reopen that PR, I will close this one.
Describe alternatives you've considered
I tried some different approaches to fixing this behavior before digging around and finding the PR (and issue) above, which is a simple 1-line change.
Testing
Game compiles and loads.
Look at a damaged part in a vehicle that is repairable (a steel frame).
Remove the part, and confirm I am able to repair it.
Install the part back into the vehicle, and confirm I am able to repair it.
Look at a damaged part in a vehicle that is not repairable (a windshield).
Remove the part. Confirm it's still not repairable.
Reinstall the part. Confirm it's still not repairable.
Additional context
This issue still persists on d95d165. I had encountered it during play when moving a motor from one vehicle to another. My character has high mechanics skill, so I thought it didn't feel right.
The supplied save from #74035 can be used to check this behavior (just skip past the many errors on loading)