From 53e78994764695dbd14268c6346028349a15adad Mon Sep 17 00:00:00 2001 From: psikomonkie <189469115+psikomonkie@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:33:16 -0500 Subject: [PATCH] Issue 5195: Made completion/finished by day calculation unambiguous --- MekHQ/src/mekhq/campaign/Campaign.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MekHQ/src/mekhq/campaign/Campaign.java b/MekHQ/src/mekhq/campaign/Campaign.java index a610f94fe1..6f104951d8 100644 --- a/MekHQ/src/mekhq/campaign/Campaign.java +++ b/MekHQ/src/mekhq/campaign/Campaign.java @@ -3370,7 +3370,7 @@ public void refit(Refit theRefit) { theRefit.addTimeSpent(tech.getMinutesLeft()); tech.setMinutesLeft(0); report = report + ", " + theRefit.getTimeLeft() + " minutes left. Completion "; - int daysLeft = (int) Math.ceil(theRefit.getTimeLeft() / tech.getDailyAvailableTechTime()) + 1; + int daysLeft = (int) Math.ceil((double) theRefit.getTimeLeft() / (double) tech.getDailyAvailableTechTime()); if (daysLeft == 1) { report += " tomorrow."; } else { @@ -3411,7 +3411,7 @@ public void refit(Refit theRefit) { if (!theRefit.isBeingRefurbished()) { refit(theRefit); report += " Completion "; - int daysLeft = (int) Math.ceil(theRefit.getTimeLeft() / tech.getDailyAvailableTechTime()) + 1; + int daysLeft = (int) Math.ceil((double) theRefit.getTimeLeft() / (double) tech.getDailyAvailableTechTime()); if (daysLeft == 1) { report += " tomorrow."; } else { @@ -3553,7 +3553,7 @@ public String fixPart(IPartWork partWork, Person tech) { report += " minutes left. Work"; if ((minutesUsed > 0) && (tech.getDailyAvailableTechTime() > 0)) { report += " will be finished "; - int daysLeft = (int) Math.ceil(partWork.getTimeLeft() / tech.getDailyAvailableTechTime()) + 1; + int daysLeft = (int) Math.ceil((double) partWork.getTimeLeft() / (double)tech.getDailyAvailableTechTime()); if (daysLeft == 1) { report += " tomorrow."; } else {