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

Fix: Fixed Abtakha Availability #6874

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 1 commit into from
May 6, 2025
Merged

Conversation

IllianiBird
Copy link
Collaborator

The Abtakha personnel option was not correctly displaying because the check we were using specifically excluded bondsmen. This fixes the check.

8000 @IllianiBird IllianiBird added Bug 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
@IllianiBird IllianiBird changed the title Fix: Fixed Abtakha Fix: Fixed Abtakha Availability May 4, 2025
Copy link
codecov bot commented May 4, 2025

Codecov Report

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

Project coverage is 11.52%. Comparing base (3f2d5f0) to head (3deb7af).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
.../mekhq/gui/adapter/PersonnelTableMouseAdapter.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #6874   +/-   ##
=========================================
  Coverage     11.52%   11.52%           
- Complexity     6567     6571    +4     
=========================================
  Files          1100     1100           
  Lines        140971   140971           
  Branches      21845    21845           
=========================================
+ Hits          16243    16249    +6     
+ Misses       123030   123022    -8     
- Partials       1698     1700    +2     

☔ 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 aims to fix the logic used to determine when to display the Abtakha personnel option. The changes update the conditions that check personnel availability and campaign type:

  • Replaced a check for all prisoners with a check for any free personnel.
  • Updated the clan check from getFaction().isClan() to isClanCampaign().
Comments suppressed due to low confidence (2)

MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java:1967

  • The new condition using 'StaticChecks.areAnyFree(selected)' significantly changes the logic from checking if all are prisoners to checking if any are free. Confirm that this change accurately reflects the intended behavior for displaying the menu options.
if (!StaticChecks.a
8000
reAnyFree(selected)) {

MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java:1983

  • Switching from 'getCampaign().getFaction().isClan()' to 'getCampaign().isClanCampaign()' could affect which campaigns qualify for displaying the Abtakha option. Verify that 'isClanCampaign()' correctly covers all intended cases for this feature.
if ((getCampaign().isClanCampaign()) && (StaticChecks.areAnyBondsmen(selected))) {

@HammerGS HammerGS requested a review from Copilot May 6, 2025 02:47
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 the incorrect display of Abtakha personnel by updating the conditions used to determine personnel availability.

  • Replaces the prisoner check with a condition relying on the availability of free personnel.
  • Updates the clan check from using getFaction().isClan() to isClanCampaign() for improved clarity.
Comments suppressed due to low confidence (2)

MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java:1967

  • Review the inversion logic here; ensure that using areAnyFree provides the correct filtering for Abtakha personnel without unintentionally excluding valid cases.
if (!StaticChecks.areAnyFree(selected)) {

MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java:1983

  • The updated check using isClanCampaign improves clarity; please ensure that the new method encapsulates all necessary logic compared to the old getFaction().isClan() approach.
if ((getCampaign().isClanCampaign()) && (StaticChecks.areAnyBondsmen(selected))) {

@Scoppio Scoppio merged commit 3a914a5 into MegaMek:master May 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 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