Skip to content
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

Always check if crew is KOed before rerolling edge #5875

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

Algebro7
Copy link
Collaborator

@Algebro7 Algebro7 commented Aug 8, 2024

#5855 introduced a bug where crew KOs would trigger rerolling edge until the pilot blacked out. This occurred because the isKoThisRound() check was accidentally grouped with shouldUseEdge(OptionsConstants.EDGE_WHEN_KO, and then the || EDGE_WHEN_AERO condition was firing each time. This PR should fix the problem by re-grouping the conditions such that isKoThisRound() is always checked, and must be true with either of the EDGE options also true.

I tested this with mechs and it seems to show the expected behavior again:

mechs

Closes #5874

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.88%. Comparing base (8bab678) to head (1bdf04c).
Report is 50 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5875      +/-   ##
============================================
- Coverage     28.98%   28.88%   -0.10%     
+ Complexity    13913    13907       -6     
============================================
  Files          2512     2538      +26     
  Lines        267321   268200     +879     
  Branches      47806    47899      +93     
============================================
- Hits          77473    77467       -6     
- Misses       185894   186777     +883     
- Partials       3954     3956       +2     

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

Copy link
Collaborator

@IllianiCBT IllianiCBT left a comment

Choose a reason for hiding this comment

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

LGTM

@Sleet01 Sleet01 merged commit aed40bb into MegaMek:master Aug 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.50.0-SNAPSHOT] Edge anomalously keeps rerolling until failed for conscious check.
3 participants