version 1.16 | | version 1.17 |
---|
| | |
/* | | /* |
* static char *rcsid_alchemy_c = | | * static char *rcsid_alchemy_c = |
* "$Id: alchemy.c,v 1.16 2003/01/21 01:23:17 garbled Exp $"; | | * "$Id: alchemy.c,v 1.17 2003/01/30 00:07:09 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
while(tmp) { | | while(tmp) { |
tval=0; | | tval=0; |
strcpy(name,tmp->name); | | strcpy(name,tmp->name); |
if(tmp->title) sprintf(name,"%s %s",tmp->name,tmp->title); | | if (tmp->title) |
| | sprintf(name, "%s %s", tmp->name, tmp->title); |
| | /* strip the materialname out of the name, so alchemy works */ |
| | if (tmp->materialname && !strncmp(tmp->materialname, tmp->name, |
| | strlen(tmp->materialname))) { |
| | tval = ((strtoint(name) - strtoint(tmp->materialname) - |
| | strtoint(" ")) * (tmp->nrof?tmp->nrof:1)); |
| | } else |
tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); | | tval = (strtoint(name) * (tmp->nrof?tmp->nrof:1)); |
#ifdef ALCHEMY_DEBUG | | #ifdef ALCHEMY_DEBUG |
LOG(llevDebug,"Got ingredient %d %s(%d)\n",tmp->nrof?tmp->nrof:1, | | LOG(llevDebug,"Got ingredient %d %s(%d)\n",tmp->nrof?tmp->nrof:1, |
| | |
tmp->weight=weight; | | tmp->weight=weight; |
tmp->value=0; | | tmp->value=0; |
tmp->material=material; | | tmp->material=material; |
| | tmp->materialname = add_string("stone"); |
free_string(tmp->name); | | free_string(tmp->name); |
tmp->name=add_string("slag"); | | tmp->name=add_string("slag"); |
if (tmp->name_pl) free_string(tmp->name_pl); | | if (tmp->name_pl) free_string(tmp->name_pl); |