Skip to content

Fix armor location not showing when stripping in salvage mode (Fixes #8724)#8728

Open
HammerGS wants to merge 1 commit intomainfrom
fix/8724-armor-location-salvage
Open

Fix armor location not showing when stripping in salvage mode (Fixes #8724)#8728
HammerGS wants to merge 1 commit intomainfrom
fix/8724-armor-location-salvage

Conversation

@HammerGS
Copy link
Member

@HammerGS HammerGS commented Feb 5, 2026

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

…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").
@HammerGS HammerGS requested a review from a team as a code owner February 5, 2026 03:07
Copilot AI review requested due to automatic review settings February 5, 2026 03:07
@HammerGS HammerGS added the AI Generated Code AI-generated fix. Requires human testing and review before merging. label Feb 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Code AI-generated fix. Requires human testing and review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

50.11 - Location not showing when stripping armor in salvage mode

1 participant

Comments