Skip to content

Commit

Permalink
Merge pull request #5298 from psikomonkie/issue-5195-remaining-time-f…
Browse files Browse the repository at this point in the history
…or-repairs-ambiguous

Issue 5195: Made completion/finished by day calculation unambiguous
  • Loading branch information
IllianiCBT authored Dec 12, 2024
2 parents 1adaf8f + 53e7899 commit f17a228
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.</b>";
} else {
Expand Down Expand Up @@ -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.</b>";
} else {
Expand Down Expand Up @@ -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.</b>";
} else {
Expand Down

0 comments on commit f17a228

Please sign in to comment.