diff --git a/MekHQ/src/mekhq/campaign/personnel/Person.java b/MekHQ/src/mekhq/campaign/personnel/Person.java index 91603a68df..b6842d72f6 100644 --- a/MekHQ/src/mekhq/campaign/personnel/Person.java +++ b/MekHQ/src/mekhq/campaign/personnel/Person.java @@ -3777,7 +3777,9 @@ public int getDailyAvailableTechTime() { } public int getMaintenanceTimeUsing() { - return getTechUnits().stream().mapToInt(Unit::getMaintenanceTime).sum(); + return getTechUnits().stream() + .filter(unit -> !(unit.isRefitting() && unit.getRefit().getTech() == this)) + .mapToInt(Unit::getMaintenanceTime).sum(); } public boolean isMothballing() { diff --git a/MekHQ/src/mekhq/gui/enums/PersonnelTableModelColumn.java b/MekHQ/src/mekhq/gui/enums/PersonnelTableModelColumn.java index 77bf995d8f..a13e77404a 100644 --- a/MekHQ/src/mekhq/gui/enums/PersonnelTableModelColumn.java +++ b/MekHQ/src/mekhq/gui/enums/PersonnelTableModelColumn.java @@ -38,6 +38,7 @@ import mekhq.campaign.unit.Unit; import mekhq.campaign.universe.Planet; import mekhq.gui.sorter.*; +import mekhq.utilities.ReportingUtilities; import javax.swing.*; import java.util.Comparator; @@ -526,13 +527,21 @@ public String getCellValue(final Campaign campaign, final PersonnelMarket person // Check for tech units if (!person.getTechUnits().isEmpty()) { + Unit refitUnit = person.getTechUnits().stream() + .filter(u -> u.isRefitting() && u.getRefit().getTech() == person) + .findFirst().orElse(null); + String refitString = null != refitUnit ? + "Refitting " + refitUnit.getName() : ""; if (person.getTechUnits().size() == 1) { unit = person.getTechUnits().get(0); if (unit != null) { - return unit.getName() + " (" + person.getMaintenanceTimeUsing() + "m)"; + return "" + ReportingUtilities.separateIf(refitString, ", ", + unit.getName() + " (" + person.getMaintenanceTimeUsing() + "m)") + ""; } } else { - return person.getTechUnits().size() + " units (" + person.getMaintenanceTimeUsing() + "m)"; + return "" + ReportingUtilities.separateIf(refitString, ", ", + person.getTechUnits().size() + " units (" + person.getMaintenanceTimeUsing() + "m)") + + ""; } } }