Skip to content

Fix #5722, #7438: Added New Repair GM Option to Instantly Acquire Required Part and GM Repair#9108

Open
IllianiBird wants to merge 5 commits into
MegaMek:mainfrom
IllianiBird:gmRepairAndAcquire
Open

Fix #5722, #7438: Added New Repair GM Option to Instantly Acquire Required Part and GM Repair#9108
IllianiBird wants to merge 5 commits into
MegaMek:mainfrom
IllianiBird:gmRepairAndAcquire

Conversation

@IllianiBird
Copy link
Copy Markdown
Collaborator

Fix #5722
Fix #7438

When players GM repair a task (such as damaged items), if the player doesn't have the replacement part, the task would report it was successful. However, the task would never actually be performed.

This PR adds a new option to GM repair a task and, at the same time, magically procure it via GM acquisition.

Is god darned task took three frickin' hours. Why? Why are Parts such problem children!?

@IllianiBird IllianiBird self-assigned this May 26, 2026
@IllianiBird IllianiBird requested a review from a team as a code owner May 26, 2026 21:06
@IllianiBird IllianiBird added Bug Parts/Repair/Refit Severity: Low Issues described as low severity as per the new issue form labels May 26, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 0% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.20%. Comparing base (f2bf383) to head (5759933).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...Q/src/mekhq/gui/adapter/TaskTableMouseAdapter.java 0.00% 34 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9108   +/-   ##
=========================================
  Coverage     15.20%   15.20%           
- Complexity     9335     9340    +5     
=========================================
  Files          1311     1312    +1     
  Lines        173407   173465   +58     
  Branches      26220    26223    +3     
=========================================
+ Hits          26372    26381    +9     
- Misses       143957   144011   +54     
+ Partials       3078     3073    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +169 to +170
gui.getCampaign()
.addReport(TECHNICAL, String.format("GM Repair, %s %s", p.getPartName(), p.succeed()));
Copy link
Copy Markdown
Collaborator

@Sleet01 Sleet01 May 29, 2026

Choose a reason for hiding this comment

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

Should this be above at line 160?
It looks like this function may be called by non-GM fixes as well as GM fixes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this seems like an odd place... also lots of single letter variable names...

Smells like something I intended to clean up later and forgot

Copy link
Copy Markdown
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

I'm not clear if the reporting about GM fixes is actually needed every time the function is called, but if so then it should be fine.

@IllianiBird
Copy link
Copy Markdown
Collaborator Author

I'm not clear if the reporting about GM fixes is actually needed every time the function is called, but if so then it should be fine.

There were issues with this PR, since corrected, but this wasn't one of them. This whole chunk of methods is only called within the context of GM repair. Non-GM repair isn't handled by the context menu but a dedicated button.

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

Labels

Bug Parts/Repair/Refit Severity: Low Issues described as low severity as per the new issue form

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] [NIGHTLY 07-26] GM Repairs Don't Work If You Don't Have The Part In Stock Change GM Acquire to Bypass Normal Acquisition Requirements

2 participants