diff --git a/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java b/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java index d58c104170..55e07e1dda 100644 --- a/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java +++ b/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java @@ -31,6 +31,7 @@ import mekhq.campaign.personnel.enums.PersonnelStatus; import mekhq.campaign.personnel.enums.education.EducationLevel; import mekhq.campaign.personnel.enums.education.EducationStage; +import mekhq.campaign.personnel.familyTree.Genealogy; import mekhq.campaign.personnel.randomEvents.enums.personalities.Intelligence; import mekhq.utilities.ReportingUtilities; @@ -247,11 +248,29 @@ public static void enrollPerson(Campaign campaign, Person person, Academy academ person.setEduJourneyTime(campaign.getSimplifiedTravelTime(campaign.getSystemById(campus))); person.setEduAcademySystem(campus); } + } + + Genealogy genealogy = person.getGenealogy(); + Person spouse = genealogy.getSpouse(); + List children = genealogy.getChildren(); + + boolean hasActiveParent = false; + if (spouse != null) { + if (spouse.getStatus().isActive() && spouse.isDependent()) { + person.addEduTagAlong(spouse.getId()); + spouse.changeStatus(campaign, campaign.getLocalDate(), PersonnelStatus.ON_LEAVE); + } - for (Person child : person.getGenealogy().getChildren()) { - if ((child.getStatus().isActive()) && (child.isChild(campaign.getLocalDate()))) { - person.addEduTagAlong(child.getId()); - child.changeStatus(campaign, campaign.getLocalDate(), PersonnelStatus.ON_LEAVE); + hasActiveParent = spouse.getStatus().isActive(); + } + + if (!hasActiveParent) { + for (Person child : children) { + if (child.getStatus().isActive()) { + if (child.isChild(campaign.getLocalDate())) { + person.addEduTagAlong(child.getId()); + child.changeStatus(campaign, campaign.getLocalDate(), PersonnelStatus.ON_LEAVE); + } } } } diff --git a/MekHQ/src/mekhq/campaign/personnel/procreation/AbstractProcreation.java b/MekHQ/src/mekhq/campaign/personnel/procreation/AbstractProcreation.java index f7789ef3aa..9ef0d7b5cd 100644 --- a/MekHQ/src/mekhq/campaign/personnel/procreation/AbstractProcreation.java +++ b/MekHQ/src/mekhq/campaign/personnel/procreation/AbstractProcreation.java @@ -33,7 +33,6 @@ import mekhq.campaign.log.PersonalLogger; import mekhq.campaign.personnel.Person; import mekhq.campaign.personnel.PersonnelOptions; -import mekhq.campaign.personnel.education.EducationController; import mekhq.campaign.personnel.enums.*; import mekhq.campaign.personnel.enums.education.EducationLevel; import mekhq.campaign.universe.Faction; @@ -371,9 +370,7 @@ public void birth(final Campaign campaign, final LocalDate today, final Person m campaign.recruitPerson(baby, prisonerStatus, true, true); // if the mother is at school, add the baby to the list of tag alongs - if ((mother.getEduAcademyName() != null) - && (!EducationController.getAcademy(mother.getEduAcademySet(), mother.getEduAcademyNameInSet()).isHomeSchool())) { - + if (mother.getStatus().isStudent()) { mother.addEduTagAlong(baby.getId()); baby.changeStatus(campaign, today, PersonnelStatus.ON_LEAVE); }