From dabb8ae3c2fec05ba79d40005ff1982768f7c3d2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 19 May 2006 19:37:33 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=907 Fix to the fix for ship-damage --- src/common/gamecode/creport.c | 2 +- src/common/gamecode/report.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index d4a09cb75..60b624899 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -570,7 +570,7 @@ cr_output_ship(FILE * F, const ship * sh, const unit * u, int fcaptain, const fa fprintf(F, "\"%s\";Typ\n", add_translation(sh->type->name[0], locale_string(f->locale, sh->type->name[0]))); fprintf(F, "%d;Groesse\n", sh->size); if (sh->damage) { - int percent = (sh->damage+DAMAGE_SCALE-1)*100/(sh->size*DAMAGE_SCALE); + int percent = (sh->damage*100+DAMAGE_SCALE-1)/(sh->size*DAMAGE_SCALE); fprintf(F, "%d;Schaden\n", percent); } if (u) diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 3e084687c..823447f77 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2105,7 +2105,7 @@ report_plaintext(const char * filename, report_context * ctx) sh->type->construction->maxsize); } if (sh->damage) { - int percent = (sh->damage+DAMAGE_SCALE-1)*100/(sh->size*DAMAGE_SCALE); + int percent = (sh->damage*100+DAMAGE_SCALE-1)/(sh->size*DAMAGE_SCALE); sprintf(buf+strlen(buf), ", %d%% %s", percent, LOC(f->locale, "nr_damaged")); } if (!fval(r->terrain, SEA_REGION)) {