From a9a14a79d040aeeb0878bec92e3935b6e97284b0 Mon Sep 17 00:00:00 2001 From: Steffen Mecke Date: Thu, 29 Jan 2015 23:28:55 +0100 Subject: [PATCH] fixed messed up english strings for wounds --- res/core/de/strings.xml | 8 ++++---- src/reports.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/res/core/de/strings.xml b/res/core/de/strings.xml index 5b2637c3f..0cd699f53 100644 --- a/res/core/de/strings.xml +++ b/res/core/de/strings.xml @@ -3569,13 +3569,13 @@ - + sehr stark - critically wounded + super strong - + stark - heavily wounded + strong schwer verwundet diff --git a/src/reports.c b/src/reports.c index 1dc779ff6..c32902df0 100644 --- a/src/reports.c +++ b/src/reports.c @@ -126,18 +126,24 @@ const char *report_kampfstatus(const unit * u, const struct locale *lang) const char *hp_status(const unit * u) { - double p = (double)((double)u->hp / (double)(u->number * unit_max_hp(u))); + double p; + int max_hp = u->number * unit_max_hp(u); + + if (u->hp == max_hp) + return NULL; + + p = (double)((double)u->hp / (double)(max_hp)); - if (p > 2.00) - return mkname("damage", "critical"); - if (p > 1.50) - return mkname("damage", "heavily"); if (p < 0.50) return mkname("damage", "badly"); if (p < 0.75) return mkname("damage", "wounded"); if (p < 0.99) return mkname("damage", "exhausted"); + if (p > 2.00) + return mkname("damage", "plusstrong"); + if (p > 1.50) + return mkname("damage", "strong"); return NULL; }