version 1.104 | | version 1.105 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.104 2005/10/07 17:54:48 akirschbaum Exp $"; | | * "$Id: object.c,v 1.105 2005/10/07 19:41:48 qal21 Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
orig_ob->nrof?orig_ob->nrof:1, orig_ob->name); | | orig_ob->nrof?orig_ob->nrof:1, orig_ob->name); |
return NULL; | | return NULL; |
} | | } |
newob=get_object(); | | newob = object_create_clone(orig_ob); |
copy_object(orig_ob,newob); | | |
if((orig_ob->nrof-=nr)<1) { | | if((orig_ob->nrof-=nr)<1) { |
if ( ! is_removed) | | if ( ! is_removed) |
remove_ob(orig_ob); | | remove_ob(orig_ob); |
| | |
} | | } |
newob->nrof=nr; | | newob->nrof=nr; |
| | |
/* Need to preserve spell information for multiple objects, eg, | | |
* books. | | |
*/ | | |
if (orig_ob->inv && orig_ob->inv->type == SPELL) { | | |
object *tmp = get_object(); | | |
copy_object(orig_ob->inv, tmp); | | |
insert_ob_in_ob(tmp, newob); | | |
} | | |
| | |
return newob; | | return newob; |
} | | } |
| | |