From 7cca06e400b1a9ca5f74b15eaf69ad02d1eebb62 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 21 Feb 2004 17:13:24 +0000 Subject: [PATCH] - missing description of blessed_harvest - missing message causes warning instead of error - curseinfo for gad/good magicresistance zone --- src/common/kernel/message.c | 2 +- src/common/util/message.c | 51 +++++++++++++++++++++++-------------- src/res/de/strings.xml | 4 +++ src/res/messages.xml | 16 ++++++++++++ 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/common/kernel/message.c b/src/common/kernel/message.c index 64dd3d578..83f6d13cc 100644 --- a/src/common/kernel/message.c +++ b/src/common/kernel/message.c @@ -395,7 +395,7 @@ msg_message(const char * name, const char* sig, ...) memset(args, 0, sizeof(args)); if (!mtype) { - log_error(("trying to create message of unknown type \"%s\"\n", name)); + log_warning(("trying to create message of unknown type \"%s\"\n", name)); return NULL; } diff --git a/src/common/util/message.c b/src/common/util/message.c index 44b9a60e3..49cc8310e 100644 --- a/src/common/util/message.c +++ b/src/common/util/message.c @@ -14,6 +14,8 @@ #include #include "message.h" +#include "goodies.h" + /* libc includes */ #include #include @@ -109,31 +111,42 @@ msg_create_va(const struct message_type * type, ...) typedef struct messagetype_list { struct messagetype_list * next; - const message_type * type; + const struct message_type * data; } messagetype_list; -static messagetype_list * messagetypes; - -const message_type * -mt_register(const message_type * type) -{ - messagetype_list * mtl = messagetypes; - while (mtl && mtl->type!=type) mtl=mtl->next; - if (mtl==NULL) { - mtl = malloc(sizeof(messagetype_list)); - mtl->type = type; - mtl->next = messagetypes; - messagetypes = mtl; - } - return type; -} +#define MT_MAXHASH 1023 +static messagetype_list * messagetypes[MT_MAXHASH]; const message_type * mt_find(const char * name) { - messagetype_list * mtl = messagetypes; - while (mtl && strcasecmp(mtl->type->name, name)!=0) mtl=mtl->next; - return mtl?mtl->type:NULL; + const struct message_type * found = NULL; + unsigned int hash = hashstring(name) % MT_MAXHASH; + messagetype_list * type = messagetypes[hash]; + while (type) { + if (strcmp(type->data->name, name)==0) { + if (found==NULL) found = type->data; + break; + } + type = type->next; + } + return found; +} + + +const message_type * +mt_register(const message_type * type) +{ + unsigned int hash = hashstring(type->name) % MT_MAXHASH; + messagetype_list * mtl = messagetypes[hash]; + while (mtl && mtl->data!=type) mtl=mtl->next; + if (mtl==NULL) { + mtl = malloc(sizeof(messagetype_list)); + mtl->data = type; + mtl->next = messagetypes[hash]; + messagetypes[hash] = mtl; + } + return type; } void diff --git a/src/res/de/strings.xml b/src/res/de/strings.xml index 6d4ab3c90..6b6642a58 100644 --- a/src/res/de/strings.xml +++ b/src/res/de/strings.xml @@ -4009,6 +4009,10 @@ they will flee from the dreadful chants and try to make their escape. + + Dieses Ernteritual verbessert die Erträge der arbeitenden Bauern in der Region um ein Silberstück. Je mehr Kraft der Druide investiert, desto länger wirkt der Zauber. + This ritual increases the output of the local farms. Peasants in the region produce an extra silverpiece. The stronger the druid's spell is, the longer the effect will last. + Aus den uralten Gesängen der Katzen entstammt dieses magisches Lied, welches vor einem diff --git a/src/res/messages.xml b/src/res/messages.xml index dbe8726c6..0734640ea 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -25,6 +25,22 @@ "($int36($id))" "($int36($id))" + + + + + "Die natürliche Widerstandskraft gegen Verzauberung bestimmter Einheiten in dieser Region wurde gestärkt. ($int36($id))" + "($int36($id))" + "($int36($id))" + + + + + + "Die natürliche Widerstandskraft gegen Verzauberung bestimmter Einheiten in dieser Region wurde geschwächt. ($int36($id))" + "($int36($id))" + "($int36($id))" +