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

Removed Automatic Pilot Pickup Assumption #4454

Merged
merged 4 commits into from
Jul 23, 2024

Conversation

IllianiCBT
Copy link
Collaborator

Previously, with the Ejected Pilots Flee option enabled, all enemy personnel were considered 'picked up.' It seems the intent was for this to apply only to ejected personnel. Unfortunately, the reality is that this resulted in all enemy personnel being classified as 'picked up'. However,_ this bug wasn't an issue before because the 'was picked up' variable was never properly set, so nothing significant was done with that information.

In my recent rework, I set the 'was picked up' value so that picked-up personnel would be automatically captured, as originally intended. However, I missed the above bug, resulting in all non-KIA enemy personnel being classified as captured if Ejected Pilots Flee was enabled.

With this PR, I removed the handler that classified all enemy personnel as being picked up. Now, when using Ejected Pilots Flee, enemy personnel will roll to see if they have been captured, just as they would if the option were disabled. To account for the reduced likelihood of injuring or picking up ejected enemy personnel, I lowered the capture target number from 6 to 5+ (only when Ejected Pilots Flee is enabled).

Closes #4447

The code that automatically assumed all ejected pilots were picked up if the player controlled the battlefield & was using ejected pilots flee was removed.
The capture checking logic is now refactored and extracted into a separate method `rollForCapture`.
The condition for the dice roll in the ResolveScenarioWizardDialog was modified. Previously, it was checking for an exact match with the target, but now it checks for whether the rolled number is greater than or equal to the target.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.24%. Comparing base (1a6bf53) to head (962a821).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4454      +/-   ##
============================================
- Coverage     10.24%   10.24%   -0.01%     
+ Complexity     5809     5808       -1     
============================================
  Files           924      924              
  Lines        126441   126441              
  Branches      18768    18767       -1     
============================================
- Hits          12953    12951       -2     
- Misses       112213   112214       +1     
- Partials       1275     1276       +1     

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

@IllianiCBT IllianiCBT merged commit dfad26e into MegaMek:master Jul 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[0.50.0-nightly] All non-KIA enemy personnel default marked as captured
3 participants