From 96d6cc03a5b75b09a320af438a44888044aa4ae2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 18 Feb 2001 08:37:57 +0000 Subject: [PATCH] bugfixes: parser, directions --- src/common/attributes/attributes-6.dsp | 8 ++++++ src/common/kernel/eressea.c | 7 ++++-- src/common/kernel/item.c | 22 ++++++++++++++--- src/eressea/eressea-6.dsp | 34 ++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/common/attributes/attributes-6.dsp b/src/common/attributes/attributes-6.dsp index 18bfd5223..cf109778b 100644 --- a/src/common/attributes/attributes-6.dsp +++ b/src/common/attributes/attributes-6.dsp @@ -97,6 +97,10 @@ SOURCE=.\giveitem.h # End Source File # Begin Source File +SOURCE=.\gm.h +# End Source File +# Begin Source File + SOURCE=.\hate.h # End Source File # Begin Source File @@ -138,6 +142,10 @@ SOURCE=.\giveitem.c # End Source File # Begin Source File +SOURCE=.\gm.c +# End Source File +# Begin Source File + SOURCE=.\hate.c # End Source File # Begin Source File diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 09895f8c2..ce64f1530 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -1,6 +1,6 @@ /* vi: set ts=2: * - * $Id: eressea.c,v 1.16 2001/02/17 14:47:42 enno Exp $ + * $Id: eressea.c,v 1.17 2001/02/18 08:37:57 enno Exp $ * Eressea PB(E)M host Copyright (C) 1998-2000 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) @@ -2144,7 +2144,10 @@ finddirection(const char *s) static tnode dirnames; int dir; - if (!init) init_directions(&dirnames); + if (!init) { + init_directions(&dirnames); + init=true; + } if (findtoken(&dirnames, s, (void**)&dir)==E_TOK_SUCCESS) { return (direction_t)dir; diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index aae485b11..57ea6dd79 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -1,6 +1,6 @@ /* vi: set ts=2: * - * $Id: item.c,v 1.12 2001/02/15 02:41:46 enno Exp $ + * $Id: item.c,v 1.13 2001/02/18 08:37:57 enno Exp $ * Eressea PB(E)M host Copyright (C) 1998-2000 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) @@ -1219,7 +1219,7 @@ limit_oldtypes(const region * r, const resource_type * rtype) static void -use_oldtypes(region * r, const resource_type * rtype, int norders) +use_oldresource(region * r, const resource_type * rtype, int norders) /* TODO: split into seperate functions. really much nicer. */ { assert(norders>0); @@ -1248,6 +1248,19 @@ use_oldtypes(region * r, const resource_type * rtype, int norders) } } +static int +use_olditem(struct unit * user, const struct item_type * itype, const char * cmd) +{ + item_t i; + for (i=0;i!=MAXITEMS;++i) { + if (olditemtype[i]==itype) { + strlist * s = makestrlist(cmd); + itemdata[i].benutze_funktion(user->region, user, s); + } + } + return 0; +} + typedef const char* translate_t[5]; static translate_t translation[] = { { "Holz", "log", "logs", "log", "logs" }, @@ -1385,10 +1398,13 @@ init_olditems(void) { resource_limit * rdata = (resource_limit*)a->data.v; rdata->limit = limit_oldtypes; - rdata->use = use_oldtypes; + rdata->use = use_oldresource; } break; } + if (itemdata[i].benutze_funktion) { + itype->use = use_olditem; + } itype->construction = con; olditemtype[i] = itype; oldresourcetype[item2res(i)] = rtype; diff --git a/src/eressea/eressea-6.dsp b/src/eressea/eressea-6.dsp index 9b12c2e1c..a0c42bb20 100644 --- a/src/eressea/eressea-6.dsp +++ b/src/eressea/eressea-6.dsp @@ -836,6 +836,40 @@ SOURCE=..\common\attributes\giveitem.h # End Source File # Begin Source File +SOURCE=..\common\attributes\gm.c + +!IF "$(CFG)" == "eressea - Win32 Release" + +!ELSEIF "$(CFG)" == "eressea - Win32 Debug" + +# PROP Intermediate_Dir "..\common\attributes\Debug" + +!ELSEIF "$(CFG)" == "eressea - Win32 Conversion" + +!ELSEIF "$(CFG)" == "eressea - Win32 Profile" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\common\attributes\gm.h + +!IF "$(CFG)" == "eressea - Win32 Release" + +!ELSEIF "$(CFG)" == "eressea - Win32 Debug" + +# PROP Intermediate_Dir "..\common\attributes\Debug" + +!ELSEIF "$(CFG)" == "eressea - Win32 Conversion" + +!ELSEIF "$(CFG)" == "eressea - Win32 Profile" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=..\common\attributes\hate.c !IF "$(CFG)" == "eressea - Win32 Release"