-
Notifications
You must be signed in to change notification settings - Fork 188
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
Conversation
Codecov ReportAttention: Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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))) {
There was a problem hiding this 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))) {
The Abtakha personnel option was not correctly displaying because the check we were using specifically excluded bondsmen. This fixes the check.