diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 6c972958b..6f30cc520 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -2054,12 +2054,6 @@ init_resources(void) if (initialized) return; initialized = true; - /* alte typen registrieren: */ - init_olditems(); - init_oldherbs(); - init_oldpotions(); - init_oldscores(); - /* silver was never an item: */ r_silver = new_resourcetype(&names[0], NULL, RTF_ITEM|RTF_POOLED); i_silver = new_itemtype(r_silver, ITF_NONE, 1/*weight*/, 0); @@ -2298,4 +2292,10 @@ 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/save.c b/src/common/kernel/save.c index fb5be508e..cf09be3a0 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -747,7 +747,10 @@ read_items(FILE *F, item **ilist) rs(F, buf); if (!strcmp("end", buf)) break; itype = it_find(buf); - if (itype!=NULL) i_change(ilist, itype, ri(F)); + assert(itype!=NULL); + if (itype!=NULL) { + i_change(ilist, itype, ri(F)); + } } } diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index ddd73e115..b1000357a 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -744,8 +744,6 @@ parse_resources(xmlDocPtr doc) xmlNodeSetPtr nodes; int i; - init_resources(); - /* reading eressea/resources/resource */ resources = xmlXPathEvalExpression(BAD_CAST "/eressea/resources/resource", xpath); nodes = resources->nodesetval; @@ -867,6 +865,8 @@ parse_resources(xmlDocPtr doc) xmlXPathFreeContext(xpath); + init_resources(); + return 0; } diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 8b037dc6f..a44c21ab5 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -1667,7 +1667,6 @@ main(int argc, char *argv[]) init_locales(); init_attributes(); - init_resources(); #if NEW_RESOURCEGROWTH init_rawmaterials(); #endif