splitting old resource registration in two parts.

This commit is contained in:
Enno Rehling 2005-10-03 21:46:57 +00:00
parent 17958f9683
commit 1d09adb884
4 changed files with 12 additions and 10 deletions

View File

@ -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();
}

View File

@ -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));
}
}
}

View File

@ -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;
}

View File

@ -1667,7 +1667,6 @@ main(int argc, char *argv[])
init_locales();
init_attributes();
init_resources();
#if NEW_RESOURCEGROWTH
init_rawmaterials();
#endif