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

Issue 5736: Preventing Negative Personnel Income #5752

Merged

Conversation

psikomonkie
Copy link
Collaborator

Fixes #5736

An alternative to #5741

  • Added a check to ensure end-of-contract Shares payouts are not made if they would be negative. This would result in the personnel paying the campaign.
  • Maintained the TotalEarnings field, and modified the PayPersonnel method to only allow positive values. If someone wants to add a feature that charges Personnel later, I'd love to see it added through a new method to prevent accidents.
  • Shuffled around when and how we pay out salaries so we shouldn't have to iterate through all our personnel as many times when paying them

IllianiCBT and others added 3 commits January 9, 2025 20:50
Removed the `TotalEarnings` field, related methods, and all references in the codebase. This includes updates to personnel salary payments, campaign options, financial transactions, and UI components. The feature is no longer needed and simplifies code management.
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.20%. Comparing base (fd739ba) to head (5e9e2e7).
Report is 46 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5752      +/-   ##
============================================
- Coverage     10.21%   10.20%   -0.02%     
+ Complexity     6076     6069       -7     
============================================
  Files          1010     1010              
  Lines        139310   139327      +17     
  Branches      20448    20447       -1     
============================================
- Hits          14231    14217      -14     
- Misses       123703   123733      +30     
- Partials       1376     1377       +1     

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

@HammerGS HammerGS merged commit 5a064ba 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
None yet
Projects
None yet
4 participants