From 338b4185be36e7cf318a77a126d67ca1081cc140 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 6 Mar 2004 17:30:36 +0000 Subject: [PATCH] race-prefix bug fixed --- src/common/kernel/group.c | 5 ----- src/common/kernel/race.c | 10 +++++----- src/common/util/attrib.c | 2 +- src/res/messages.xml | 4 ++-- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/common/kernel/group.c b/src/common/kernel/group.c index 09146efe5..d2a21421c 100644 --- a/src/common/kernel/group.c +++ b/src/common/kernel/group.c @@ -51,11 +51,6 @@ new_group(faction * f, const char * name, int gid) g->name = strdup(name); g->gid = gid; - a = a_find(f->attribs, &at_raceprefix); - if(a) { - a_add(&g->attribs, a_new(&at_raceprefix))->data.v = strdup((char *)a->data.v); - } - g->nexthash = ghash[index]; return ghash[index] = g; } diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 120de9662..3fe7159fb 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -351,12 +351,12 @@ rc_name(const race * rc, int n) const char * raceprefix(const unit *u) { - attrib * agroup = a_find(u->attribs, &at_group); - attrib * asource = u->faction->attribs; - attrib * a2 = NULL; + const attrib * agroup = a_findc(u->attribs, &at_group); + const attrib * asource = u->faction->attribs; + const attrib * a2 = NULL; - if (agroup!=NULL) asource = ((group *)(agroup->data.v))->attribs; - a2 = a_find(asource, &at_raceprefix); + if (agroup!=NULL) asource = ((const group *)(agroup->data.v))->attribs; + a2 = a_findc(asource, &at_raceprefix); if (a2!=NULL) return (const char *)a2->data.v; return NULL; diff --git a/src/common/util/attrib.c b/src/common/util/attrib.c index 564fa2ca3..3d2226d93 100644 --- a/src/common/util/attrib.c +++ b/src/common/util/attrib.c @@ -108,7 +108,7 @@ a_add(attrib ** pa, attrib * a) } if (a->type->flags & ATF_UNIQUE && *find) { if ((*find)->type == a->type) { - /* fprintf(stderr, "duplicate attribute: %s\n", a->type->name); */ + log_printf(stderr, "duplicate attribute: %s\n", a->type->name); return a; } } diff --git a/src/res/messages.xml b/src/res/messages.xml index 8c3f0800b..856c6df83 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -828,8 +828,8 @@ "$unit($unit) in $region($region): '$command' - $unit($unit) erschafft $int($amount) ${object}." - "$unit($unit) in $region($region): '$command' - $unit($unit) creates $int($amount) ${item}." - "$unit($unit) in $region($region): '$command' - $unit($unit) creates $int($amount) ${item}." + "$unit($unit) in $region($region): '$command' - $unit($unit) creates $int($amount) ${object}." + "$unit($unit) in $region($region): '$command' - $unit($unit) creates $int($amount) ${object}."