Fix to the fix for ship-damage
This commit is contained in:
Enno Rehling 2006-05-19 19:37:33 +00:00
parent d72c0ab07e
commit dabb8ae3c2
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)) {