forked from github/server
splitting old resource registration in two parts.
This commit is contained in:
parent
17958f9683
commit
1d09adb884
|
@ -2054,12 +2054,6 @@ init_resources(void)
|
||||||
if (initialized) return;
|
if (initialized) return;
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
/* alte typen registrieren: */
|
|
||||||
init_olditems();
|
|
||||||
init_oldherbs();
|
|
||||||
init_oldpotions();
|
|
||||||
init_oldscores();
|
|
||||||
|
|
||||||
/* silver was never an item: */
|
/* silver was never an item: */
|
||||||
r_silver = new_resourcetype(&names[0], NULL, RTF_ITEM|RTF_POOLED);
|
r_silver = new_resourcetype(&names[0], NULL, RTF_ITEM|RTF_POOLED);
|
||||||
i_silver = new_itemtype(r_silver, ITF_NONE, 1/*weight*/, 0);
|
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! */
|
/* 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);
|
assert((int)I_SACK_OF_CONSERVATION == (int)R_SACK_OF_CONSERVATION);
|
||||||
|
|
||||||
|
/* alte typen registrieren: */
|
||||||
|
init_olditems();
|
||||||
|
init_oldherbs();
|
||||||
|
init_oldpotions();
|
||||||
|
init_oldscores();
|
||||||
}
|
}
|
||||||
|
|
|
@ -747,7 +747,10 @@ read_items(FILE *F, item **ilist)
|
||||||
rs(F, buf);
|
rs(F, buf);
|
||||||
if (!strcmp("end", buf)) break;
|
if (!strcmp("end", buf)) break;
|
||||||
itype = it_find(buf);
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -744,8 +744,6 @@ parse_resources(xmlDocPtr doc)
|
||||||
xmlNodeSetPtr nodes;
|
xmlNodeSetPtr nodes;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
init_resources();
|
|
||||||
|
|
||||||
/* reading eressea/resources/resource */
|
/* reading eressea/resources/resource */
|
||||||
resources = xmlXPathEvalExpression(BAD_CAST "/eressea/resources/resource", xpath);
|
resources = xmlXPathEvalExpression(BAD_CAST "/eressea/resources/resource", xpath);
|
||||||
nodes = resources->nodesetval;
|
nodes = resources->nodesetval;
|
||||||
|
@ -867,6 +865,8 @@ parse_resources(xmlDocPtr doc)
|
||||||
|
|
||||||
xmlXPathFreeContext(xpath);
|
xmlXPathFreeContext(xpath);
|
||||||
|
|
||||||
|
init_resources();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1667,7 +1667,6 @@ main(int argc, char *argv[])
|
||||||
init_locales();
|
init_locales();
|
||||||
init_attributes();
|
init_attributes();
|
||||||
|
|
||||||
init_resources();
|
|
||||||
#if NEW_RESOURCEGROWTH
|
#if NEW_RESOURCEGROWTH
|
||||||
init_rawmaterials();
|
init_rawmaterials();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue