version 1.2 | | version 1.3 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.2 1999/06/05 06:28:06 cvs Exp $"; | | * "$Id: apply.c,v 1.3 1999/07/10 23:37:45 cvs Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| | |
void apply_lighter(object *who, object *lighter) { | | void apply_lighter(object *who, object *lighter) { |
object *item = who->inv; | | object *item = who->inv; |
int nrof; | | int count,nrof; |
| | char item_name[MAX_BUF]; |
| | |
item=find_marked_object(who); | | item=find_marked_object(who); |
if(item) { | | if(item) { |
| | |
return; | | return; |
} | | } |
nrof=item->nrof; | | nrof=item->nrof; |
| | count=item->count; |
| | /* If the item is destroyed, we don't have a valid pointer to the |
| | * name object, so make a copy so the message we print out makes |
| | * some sense. |
| | */ |
| | strcpy(item_name, item->name); |
| | |
save_throw_object(item,AT_FIRE); | | save_throw_object(item,AT_FIRE); |
if ((nrof != item->nrof ) || QUERY_FLAG(item, FLAG_FREED)) { | | /* Change to check count and not freed, since the object pointer |
| | * may have gotten recycled |
| | */ |
| | if ((nrof != item->nrof ) || (count != item->count)) { |
new_draw_info_format(NDI_UNIQUE, 0,who, | | new_draw_info_format(NDI_UNIQUE, 0,who, |
"You light the %s with the %s.",item->name,lighter->name); | | "You light the %s with the %s.",item_name,lighter->name); |
} else { | | } else { |
new_draw_info_format(NDI_UNIQUE, 0,who, | | new_draw_info_format(NDI_UNIQUE, 0,who, |
"You attempt to light the %s with the %s and fail.",item->name,lighter->name); | | "You attempt to light the %s with the %s and fail.",item->name,lighter->name); |