From 66fbb409a0139c4de9773bef232c2fbe79e36f92 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 3 Oct 2005 21:52:09 +0000 Subject: [PATCH] nein, anders... --- src/common/kernel/item.c | 12 +++++------- src/common/kernel/xmlreader.c | 6 +++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 6f30cc520..29753da87 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -2074,7 +2074,6 @@ init_resources(void) r_unit = new_resourcetype(&names[12], NULL, RTF_NONE); r_unit->uchange = res_changeperson; - oldresourcetype[R_SWORD] = rt_find("sword"); oldresourcetype[R_SILVER] = r_silver; oldresourcetype[R_AURA] = r_aura; oldresourcetype[R_PERMAURA] = r_permaura; @@ -2082,6 +2081,11 @@ init_resources(void) oldresourcetype[R_PEASANTS] = r_peasants; oldresourcetype[R_UNIT] = r_unit; + /* alte typen registrieren: */ + init_olditems(); + init_oldherbs(); + init_oldpotions(); + init_oldscores(); } int @@ -2292,10 +2296,4 @@ register_resources(void) /* make sure noone has deleted an I_ tpe without deleting the R_ type that goes with it! */ assert((int)I_SACK_OF_CONSERVATION == (int)R_SACK_OF_CONSERVATION); - - /* alte typen registrieren: */ - init_olditems(); - init_oldherbs(); - init_oldpotions(); - init_oldscores(); } diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index b1000357a..31fbe10ca 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -744,6 +744,9 @@ parse_resources(xmlDocPtr doc) xmlNodeSetPtr nodes; int i; + /* make sure old items (used in requirements) are available */ + init_resources(); + /* reading eressea/resources/resource */ resources = xmlXPathEvalExpression(BAD_CAST "/eressea/resources/resource", xpath); nodes = resources->nodesetval; @@ -865,7 +868,8 @@ parse_resources(xmlDocPtr doc) xmlXPathFreeContext(xpath); - init_resources(); + /* old resources now extern (for spells */ + oldresourcetype[R_SWORD] = rt_find("sword"); return 0; }