Fix armor location not showing when stripping in salvage mode (Fixes #8724)#8728
Open
Fix armor location not showing when stripping in salvage mode (Fixes #8724)#8728
Conversation
…8724) --- PR Body ## Root Cause Commit `2cd6794741` ("Tweak", 2025-11-16) accidentally removed the salvaging branch from `Armor.getDetails()`. The original code had separate branches for salvaging (showing location + salvage amount) and repair (showing location + repair amount needed). The refactoring changed `if (isSalvaging())` to `if (!isSalvaging())` and deleted the salvaging branch entirely, causing location names to not display when stripping armor. ## Changes 1. `Armor.getDetails()` - Restored the salvaging branch that displays location name and salvage amount ## Files Changed - `MekHQ/src/mekhq/campaign/parts/Armor.java` - Restored salvage location display ## Testing 1. Have a damaged mech in salvage mode 2. Try to strip armor from a location 3. Verify location name (e.g., "Left Arm", "Center Torso") now displays Fixes #8724 --- Commit Message Fix armor location not showing when stripping in salvage mode Fixes #8724 Root cause: Commit 2cd6794 accidentally removed the salvaging branch from Armor.getDetails(), changing `if (isSalvaging())` to `if (!isSalvaging())` and deleting the code that displayed location names during salvage operations. Fix: Restored the salvaging branch that displays the location name and salvage amount (e.g., "Left Arm, 12 points").
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where armor location names were not displayed when stripping armor in salvage mode. The issue was introduced in commit 2cd6794 which accidentally removed the salvaging branch from the Armor.getDetails() method.
Changes:
- Restored the salvaging branch in
Armor.getDetails()to display location name and salvage amount
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Root Cause
Commit
2cd6794741("Tweak", 2025-11-16) accidentally removed the salvaging branch fromArmor.getDetails(). Theoriginal code had separate branches for salvaging (showing location + salvage amount) and repair (showing location +
repair amount needed). The refactoring changed
if (isSalvaging())toif (!isSalvaging())and deleted the salvagingbranch entirely, causing location names to not display when stripping armor.
Changes
Armor.getDetails()- Restored the salvaging branch that displays location name and salvage amountFiles Changed
MekHQ/src/mekhq/campaign/parts/Armor.java- Restored salvage location displayTesting
Fixes #8724