Cataclysm-DDA
Cataclysm-DDA copied to clipboard
vehicles: added force replace button
Summary
Content "vehicles: added force replace button"
Purpose of change
Less keypresses for replacing battered up veh parts ;)
Describe the solution
added the force replace button:
- In the
do_repair
function, when a vehicle part is broken, instead of doing the repair, the function will instead do the vehicle installation process. In this PR, I've addedforce_replace
boolean (replace
button callsdo_repair( true )
)
~~(I'm getting errors from my clangd LSP, plus currently unable to compile, that's why I'm setting it to WIP)~~ Not yet compiled
Describe alternatives you've considered
Not doing this and having to do 9999 more buttons to remove then install vehicle parts (NOOOOOOOO!!!)
Testing
Not yet compiled
Additional context
How does this "force replace" button work? Does it work for every vehicle part, or only for batteries?
Yes, theoretically, it works for every single vehicles (when a vehicle part is broken, it'll call installation requirements instead of reparation requirements)
Fwiw this is essentially a cheat
Assume damaged frame; instead of removing all parts on a tile, replacing the frame and re-welding/installing parts back you can "replace" it and end up paying time/charges/rods/etc just for the frame installation
If you're actively working on this PR, consider making it a draft.
I have a question which makes me feel quite wondering: Can Installation and Removal requirements be concatenated into a variable?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.