From 002a2fc628129148198bc4dfb3ad8cd7a71fe367 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 17 May 2001 23:18:53 +0000 Subject: [PATCH] small bugfixes, broken strings, and a new assert --- src/common/kernel/item.c | 16 ++++++++++++++-- src/common/kernel/message.c | 1 - src/common/modules/gmcmd.c | 2 ++ src/eressea/eressea-6.dsp | 8 ++++++++ src/res/de/strings.txt | 10 +++++----- src/res/en/strings.txt | 15 +++++++++++---- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 4e17f4825..a28a642c8 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -418,9 +418,21 @@ rt_find(const char * name) return rtype; } -item_type * -it_find(const char * name) +static const char * it_aliases[2][2] = { { "Runenschwert", "runesword" }, { NULL, NULL } }; +static const char * +it_alias(const char * zname) { + int i; + for (i=0;it_aliases[i][0];++i) { + if (strcasecmp(it_aliases[i][0], zname)==0) return it_aliases[i][1]; + } + return zname; +} + +item_type * +it_find(const char * zname) +{ + const char * name = it_alias(zname); unsigned int hash = hashstring(name); item_type * itype; diff --git a/src/common/kernel/message.c b/src/common/kernel/message.c index 8ae84ca4e..337c1bf05 100644 --- a/src/common/kernel/message.c +++ b/src/common/kernel/message.c @@ -428,7 +428,6 @@ new_message(struct faction * receiver, const char* sig, ...) static void caddmessage(region * r, faction * f, const char *s, msg_t mtype, int level) { - const char * section = NULL; message * m = NULL; unused(level); diff --git a/src/common/modules/gmcmd.c b/src/common/modules/gmcmd.c index b41b939f9..97278f658 100644 --- a/src/common/modules/gmcmd.c +++ b/src/common/modules/gmcmd.c @@ -78,6 +78,7 @@ static void write_gmcreate(const attrib * a, FILE * F) { const item_type * itype = (const item_type *)a->data.v; + assert(itype); fprintf(F, "%s", resourcename(itype->rtype, 0)); } @@ -88,6 +89,7 @@ read_gmcreate(attrib * a, FILE * F) const item_type ** p_itype = (const item_type **)&a->data.v; fscanf(F, "%s", zText); *p_itype = it_find(zText); + assert(*p_itype); return 1; } diff --git a/src/eressea/eressea-6.dsp b/src/eressea/eressea-6.dsp index 06252fe01..2599914c9 100644 --- a/src/eressea/eressea-6.dsp +++ b/src/eressea/eressea-6.dsp @@ -1385,6 +1385,14 @@ SOURCE=..\common\triggers\createunit.c # End Source File # Begin Source File +SOURCE=..\common\triggers\gate.c +# End Source File +# Begin Source File + +SOURCE=..\common\triggers\gate.h +# End Source File +# Begin Source File + SOURCE=..\common\triggers\giveitem.c !IF "$(CFG)" == "eressea - Win32 Release" diff --git a/src/res/de/strings.txt b/src/res/de/strings.txt index 523595fa9..a9dc837a5 100644 --- a/src/res/de/strings.txt +++ b/src/res/de/strings.txt @@ -110,7 +110,7 @@ temple;de;Tempel ## Testitem wand;de;Zauberstab wand_p;de;Zauberstäbe -wand_of_tear_p;de;Szepter der Tränen +wand_of_tears;de;Szepter der Tränen wands_of_tear_p;de;Szepter der Tränen ## Burgausbaustufen @@ -281,15 +281,15 @@ dreameye;de;Traumauge dreameye_p;de;Traumaugen seaserpenthead;de;Seeschlangenkopf seaserpenthead_p;de;Seeschlangenköpfe -aurafocu_p;de;Aurafocus -aurafocuse_p;de;Aurafocuse +aurafocus;de;Aurafocus +aurafocus_p;de;Aurafocuse presspass;de;Akkredition des Xontormia-Expreß presspass_p;de;Akkreditionen des Xontormia-Expreß trollbelt;de;Gürtel der Trollstärke elvenhorse;de;Elfenpferd elvenhorse_p;de;Elfenpferde -pegasu_p;de;Pegasus -pegasi;de;Pegasi +pegasus;de;Pegasus +pegasus_p;de;Pegasi dolphin;de;Delphin dolphin_p;de;Delphine museumticket;de;Eintrittskarte des Großen Museum diff --git a/src/res/en/strings.txt b/src/res/en/strings.txt index 302eb93a1..64ecc127b 100644 --- a/src/res/en/strings.txt +++ b/src/res/en/strings.txt @@ -99,8 +99,8 @@ aots;en;amulet of true seeing aots_p;en;amulets of true seeing apple;en;apple apple_p;en;apples -aurafocu_p;en;aurafocus -aurafocuse_p;en;aurafocuses +aurafocus;en;aurafocus +aurafocus_p;en;aurafocuses axe;en;axe axe_p;en;axes bow;en;bow @@ -177,8 +177,8 @@ museumticket;en;ticket to the grand museum museumticket_p;en;tickets to the grand museum nut;en;nut nut_p;en;nuts -pegasi;en;pegasi -pegasu_p;en;pegasus +pegasus;en;pegasus +pegasus_p;en;pegasi person;en;man person_p;en;men plate;en;plate @@ -587,3 +587,10 @@ ZIPPED;en;ZIPPED BZIP2;en;BZIP2 PUNKTE;en;SCORE INFO;en;INFO + +## Testitem +wand;en;wand +wand_p;en;wands +wand_of_tears;en;wand of tears +wands_of_tear_p;en;wands of tears +