From 9f146d1a0761d94aba58ac3372279529a6d78470 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 25 Jul 2006 09:21:20 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D96?= =?UTF-8?q?2=20"Merkw=C3=BCrdige=20Fehlermeldung=20bei=20Delphin"=20Neue?= =?UTF-8?q?=20Message-Funktion,=20die=20den=20Terraintyp=20einer=20Region?= =?UTF-8?q?=20ausgibt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/gamecode/report.c | 14 ++++++++++++++ src/res/messages.xml | 12 ++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 31b3b55ae..30c80bb8c 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2922,6 +2922,19 @@ eval_region(struct opstack ** stack, const void * userdata) /* region -> string opush(stack, var); } +static void +eval_terrain(struct opstack ** stack, const void * userdata) /* region -> string */ +{ + const struct faction * f = (const struct faction *)userdata; + const struct region * r = (const struct region *)opop(stack).v; + const char * c = LOC(f->locale, terrain_name(r)); + size_t len = strlen(c); + variant var; + + var.v = strcpy(balloc(len+1), c); + opush(stack, var); +} + static void eval_ship(struct opstack ** stack, const void * userdata) /* ship -> string */ { @@ -3091,6 +3104,7 @@ report_init(void) /* register functions that turn message contents to readable strings */ add_function("alliance", &eval_alliance); add_function("region", &eval_region); + add_function("terrain", &eval_terrain); add_function("weight", &eval_weight); add_function("resource", &eval_resource); add_function("race", &eval_race); diff --git a/src/res/messages.xml b/src/res/messages.xml index 39eed54ca..6d4a4dbe0 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -1969,18 +1969,18 @@ - "$unit($unit) entdeckt dass im $direction($direction) Ozean ist." - "$unit($unit) discovered that an Ocean lies in the $direction($direction)." - "$unit($unit) discovered that an Ocean lies in the $direction($direction)." + "$unit($unit) entdeckt dass im $direction($direction) $terrain($region) ist." + "$unit($unit) discovered that an ocean lies in the $direction($direction)." + "$unit($unit) discovered that an ocean lies in the $direction($direction)." - "$unit($unit) entdeckt, dass $region($region) Ozean ist." - "$unit($unit) discovered that $region($region) is Ocean." - "$unit($unit) discovered that $region($region) is Ocean." + "$unit($unit) entdeckt, dass $region($region) $terrain($region) ist." + "$unit($unit) discovered that $region($region) is $terrain($region)." + "$unit($unit) discovered that $region($region) is $terrain($region)."