8000 Fix: Fixed Astech & Medic Skill Generation by IllianiBird · Pull Request #6875 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: Fixed Astech & Medic Skill Generation #6875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2025

Conversation

IllianiBird
Copy link
Collaborator

When we moved to ATOW skills in 50.05 Astechs and Medics were set up have the full array of experience levels, rather than just 0. However, there was a missed special handler that prevented the bulk hire dialog from hiring Astechs of experience levels greater than 0. This PR addresses that.

@IllianiBird IllianiBird added Bug Personnel Personnel-related Issues Severity: Medium Issues described as medium severity as per the new issue form labels May 4, 2025
@IllianiBird IllianiBird self-assigned this May 4, 2025
Copy link
codecov bot commented May 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 11.57%. Comparing base (3f2d5f0) to head (2d1d8a9).
Report is 29 commits behind head on master.

Files with missing lines Patch % Lines
...HQ/src/mekhq/campaign/personnel/PersonUtility.java 0.00% 3 Missing ⚠️
.../src/mekhq/gui/dialog/HireBulkPersonnelDialog.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6875      +/-   ##
============================================
+ Coverage     11.52%   11.57%   +0.05%     
- Complexity     6567     6612      +45     
============================================
  Files          1100     1100              
  Lines        140971   140973       +2     
  Branches      21845    21845              
============================================
+ Hits          16243    16314      +71     
+ Misses       123030   122962      -68     
+ Partials       1698     1697       -1     

☔ 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.

@HammerGS HammerGS requested a review from Copilot May 6, 2025 02:46
Copy link
Contributor
@Copilot 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 an issue in the bulk hire dialog where the special handling for Astechs (and Medics) with non-zero experience levels was preventing their proper hiring. The changes remove the redundant check for isAssistant in the dialog, deprecate the isAssistant method in PersonnelRole, and adjust the personnel skill mapping in PersonUtility.

  • Removed the isAssistant check in HireBulkPersonnelDialog to allow proper handling of Astechs.
  • Deprecated the isAssistant method with an updated annotation and comment in PersonnelRole.
  • Revised the skill mapping in PersonUtility to separately handle ASTECH, DOCTOR, and MEDIC roles.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
MekHQ/src/mekhq/gui/dialog/HireBulkPersonnelDialog.java Removed isAssistant condition from the skill assignment logic.
MekHQ/src/mekhq/campaign/personnel/enums/PersonnelRole.java Deprecated the isAssistant method with updated documentation.
MekHQ/src/mekhq/campaign/personnel/PersonUtility.java Updated the mapping for ASTECH, DOCTOR, and MEDIC to reflect revised skill handling.
Comments suppressed due to low confidence (2)

MekHQ/src/mekhq/gui/dialog/HireBulkPersonnelDialog.java:358

  • Ensure that removal of the isAssistant condition aligns with all role eligibility rules; verify that no unintended roles are now included for skill assignment.
if ((useSkill) && (!selectedItem.getRole().isCivilian())) {

MekHQ/src/mekhq/campaign/personnel/PersonUtility.java:171

  • Confirm that the new mapping for ASTECH correctly reflects the intended skill levels as per the updated business requirements.
Map.entry(ASTECH, List.of(S_ASTECH)),

@@ -594,8 +594,9 @@ public boolean isMedicalStaff() {
}

/**
* @return true if the person is an Astech or Medic, false otherwise.
* @return Unused
Copy link
Preview
Copilot AI May 6, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider updating the Javadoc for isAssistant to clearly explain its deprecation and link it to the revised skill handling logic.

Suggested change
* @return Unused
* This method is deprecated and will be removed in a future release. It is no longer used in the current
* implementation of personnel role handling.
*
* <p>Instead of using this method, refer to the revised skill handling logic, which provides a more
* comprehensive and flexible approach to managing personnel roles. For more details, see the documentation
* for the {@code SkillAttribute} enum or consult the MekHQ user guide.</p>
*
* @return {@code true} if the character is assigned to an assistant role (e.g., Astech or Medic), {@code false} otherwise.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be @deprecated Unused

@Scoppio Scoppio merged commit e3e00f2 into MegaMek:master May 6, 2025
6 checks passed
@IllianiBird IllianiBird deleted the astechMedicSkillGeneration branch June 7, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Personnel Personnel-related Issues Severity: Medium Issues described as medium severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0