version 1.26 | | version 1.27 |
---|
| | |
| | |
/* | | /* |
* static char *rcs_treasure_c = | | * static char *rcs_treasure_c = |
* "$Id: treasure.c,v 1.26 2002/03/01 21:33:09 avogl Exp $"; | | * "$Id: treasure.c,v 1.27 2002/06/09 07:59:30 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* CMD: change_name xxxx */ | | /* CMD: change_name xxxx */ |
if(t->change_arch.name) | | if(t->change_arch.name) |
{ | | { |
if(op->name) | | FREE_AND_COPY(op->name, t->change_arch.name); |
free_string(op->name); | | /* not great, but better than something that is completely wrong */ |
op->name = add_string(t->change_arch.name); | | FREE_AND_COPY(op->name_pl, t->change_arch.name); |
} | | } |
| | |
if(t->change_arch.title) | | if(t->change_arch.title) |
| | |
} | | } |
if (op->type == POTION && special_potion(op)) { | | if (op->type == POTION && special_potion(op)) { |
/*if(op->face==blank_face) op->face = potion_face;*/ | | /*if(op->face==blank_face) op->face = potion_face;*/ |
free_string(op->name); | | FREE_AND_COPY(op->name, "potion"); |
op->name = add_string("potion"); | | FREE_AND_COPY(op->name_pl, "potions"); |
| | |
op->level = spells[op->stats.sp].level/2+ RANDOM()%difficulty + RANDOM()%difficulty; | | op->level = spells[op->stats.sp].level/2+ RANDOM()%difficulty + RANDOM()%difficulty; |
if ( ! (flags & GT_ONLY_GOOD) && RANDOM() % 2) | | if ( ! (flags & GT_ONLY_GOOD) && RANDOM() % 2) |
SET_FLAG(op, FLAG_CURSED); | | SET_FLAG(op, FLAG_CURSED); |
| | |
if(item->type==FLESH && donor) { | | if(item->type==FLESH && donor) { |
/* change the name */ | | /* change the name */ |
sprintf(tmpbuf,"%s's %s",donor->name,item->name); | | sprintf(tmpbuf,"%s's %s",donor->name,item->name); |
free_string(item->name); | | FREE_AND_COPY(item->name, tmpbuf); |
item->name=add_string(tmpbuf); | | sprintf(tmpbuf,"%s's %s",donor->name,item->name_pl); |
| | FREE_AND_COPY(item->name_pl, tmpbuf); |
| | |
/* weight is FLESH weight/100 * donor */ | | /* weight is FLESH weight/100 * donor */ |
if((item->weight = (signed long) (((double)item->weight/(double)100.0) * (double)donor->weight))==0) | | if((item->weight = (signed long) (((double)item->weight/(double)100.0) * (double)donor->weight))==0) |
item->weight=1; | | item->weight=1; |
| | |
if (at->allowed) free_charlinks(at->allowed); | | if (at->allowed) free_charlinks(at->allowed); |
if (at->item) { | | if (at->item) { |
if (at->item->name) free_string(at->item->name); | | if (at->item->name) free_string(at->item->name); |
| | if (at->item->name_pl) free_string(at->item->name_pl); |
if (at->item->msg) free_string(at->item->msg); | | if (at->item->msg) free_string(at->item->msg); |
if (at->item->title) free_string(at->item->title); | | if (at->item->title) free_string(at->item->title); |
free(at->item); | | free(at->item); |