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

Update CamOps Personnel Market to Properly Not Generate Personnel on a roll of 7 #4677

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions MekHQ/src/mekhq/campaign/market/PersonnelMarketCampaignOps.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import mekhq.module.api.PersonnelMarketMethod;

/**
* Method for personnel market generation given in the repair and maintenance section of Strategic Operations
* Method for personnel market generation given in the replacement personnel section of Campaign Operations
*/
public class PersonnelMarketCampaignOps implements PersonnelMarketMethod {
private int daysSinceRolled = 0;
Expand All @@ -49,7 +49,7 @@ public List<Person> generatePersonnelForDay(Campaign c) {
final List<PersonnelRole> techRoles = PersonnelRole.getTechRoles();
final List<PersonnelRole> vesselRoles = PersonnelRole.getVesselRoles();

Person p;
Person p = null;
int roll = Compute.d6(2);
if (roll == 2) { // Medical
p = c.newPerson(PersonnelRole.DOCTOR);
Expand All @@ -71,15 +71,15 @@ public List<Person> generatePersonnelForDay(Campaign c) {
p = c.newPerson(techRoles.get(Compute.randomInt(techRoles.size())));
} else if (roll == 12) { // Vessel Crew
p = c.newPerson(vesselRoles.get(Compute.randomInt(vesselRoles.size())));
} else {
p = c.newPerson(PersonnelRole.NONE);
}
daysSinceRolled = 0;
return Collections.singletonList(p);
if (p != null) {
return Collections.singletonList(p);
}
} else {
daysSinceRolled++;
return null;
}
return null;
}

@Override
Expand Down