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

Fixed Maternity Leave... yet again #5725

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

IllianiCBT
Copy link
Collaborator

  • Moved maternity leave handler into procreation weekly activity.
  • Cleared up the handling of going on or returning from maternity leave.

Fix #5714 (tentative)

Moved maternity leave status changes from Campaign to AbstractProcreation for better encapsulation and logic centralization. Ensured proper status updates when pregnancies end and added safeguards for returning personnel to active duty.
The code no longer redundantly resets maternity leave status for non-pregnant characters, as this logic was already handled elsewhere. Added unit tests to ensure correct behavior for various scenarios, such as different genders and pregnancy states. This cleanup improves clarity and prevents unnecessary status updates.
@IllianiCBT IllianiCBT added Bug Personnel Personnel-related Issues labels Jan 9, 2025
@IllianiCBT IllianiCBT self-assigned this Jan 9, 2025
@Scoppio
Copy link
Collaborator

Scoppio commented Jan 9, 2025

I think the tag should be "personal", because it is starting to get personal

@IllianiCBT
Copy link
Collaborator Author

This is my own personnel hell, if you will

Copy link
Collaborator

@Scoppio Scoppio left a comment

Choose a reason for hiding this comment

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

The only downside I see is that if you could disable procreation in the middle of someone being on maternity leave, they probably would never return.

@IllianiCBT
Copy link
Collaborator Author

If you disable procreation people will stop becoming pregnant, I don't believe it removes active pregnancies.

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.19%. Comparing base (16ea3f7) to head (3f0eecf).
Report is 56 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5725      +/-   ##
============================================
- Coverage     10.21%   10.19%   -0.02%     
+ Complexity     6070     6067       -3     
============================================
  Files          1009     1010       +1     
  Lines        139242   139352     +110     
  Branches      20437    20447      +10     
============================================
- Hits          14221    14212       -9     
- Misses       123651   123765     +114     
- Partials       1370     1375       +5     

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

@HammerGS HammerGS merged commit a9ec2eb into MegaMek:master Jan 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Personnel Personnel-related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Mekwarrior gave birth two separate times within 7 days
5 participants