support for old item

This commit is contained in:
Enno Rehling 2008-05-27 07:59:23 +00:00
parent 577601f912
commit 363c2e0d5b
2 changed files with 11 additions and 6 deletions

View file

@ -555,15 +555,16 @@ read_items(struct storage * store, item **ilist)
for (;;) { for (;;) {
char ibuf[32]; char ibuf[32];
const item_type * itype; const item_type * itype;
int i;
store->r_str_buf(store, ibuf, sizeof(ibuf)); store->r_str_buf(store, ibuf, sizeof(ibuf));
if (!strcmp("end", ibuf)) break; if (!strcmp("end", ibuf)) break;
itype = it_find(ibuf); itype = it_find(ibuf);
assert(itype!=NULL); i = store->r_int(store);
if (itype!=NULL) {
int i = store->r_int(store);
if (i<=0) { if (i<=0) {
log_error(("data contains an entry with %d %s\n", i, itype->rtype->_name[1])); log_error(("data contains an entry with %d %s\n", i, itype->rtype->_name[1]));
} else { } else {
assert(itype!=NULL);
if (itype!=NULL) {
i_change(ilist, itype, i); i_change(ilist, itype, i);
} }
} }

View file

@ -32,6 +32,10 @@
<item notlost="yes" weight="0"/> <item notlost="yes" weight="0"/>
</resource> </resource>
<resource name="lebkuchenherz">
<item notlost="yes" weight="0"/>
</resource>
<!-- ambassador rewards --> <!-- ambassador rewards -->
<resource name="seashell"> <resource name="seashell">
<item cursed="true" weight="0"> <item cursed="true" weight="0">