version 1.84 | | version 1.85 |
---|
| | |
/* | | /* |
* static char *rcsid_c_object_c = | | * static char *rcsid_c_object_c = |
* "$Id: c_object.c,v 1.84 2006/07/29 08:39:29 ryo_saeba Exp $"; | | * "$Id: c_object.c,v 1.85 2006/08/12 12:00:31 gros Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
{ | | { |
object *tmp, *next; | | object *tmp, *next; |
int did_one=0; | | int did_one=0; |
| | int ival=0; |
| | int missed = 0; |
| | |
if (!params) { | | if (!params) { |
new_draw_info(NDI_UNIQUE,0, op, "Drop what?"); | | new_draw_info(NDI_UNIQUE,0, op, "Drop what?"); |
| | |
} else { | | } else { |
for (tmp=op->inv; tmp; tmp=next) { | | for (tmp=op->inv; tmp; tmp=next) { |
next=tmp->below; | | next=tmp->below; |
if (QUERY_FLAG(tmp,FLAG_NO_DROP) || | | if (QUERY_FLAG(tmp,FLAG_NO_DROP) || tmp->invisible) continue; |
tmp->invisible) continue; | | if ((ival = item_matched_string(op,tmp,params))>0) { |
if (item_matched_string(op,tmp,params)) { | | if ((QUERY_FLAG(tmp, FLAG_INV_LOCKED))&&((ival==1)||(ival==2))) |
| | missed++; |
| | else |
drop(op, tmp); | | drop(op, tmp); |
did_one=1; | | did_one=1; |
} | | } |
} | | } |
if (!did_one) new_draw_info(NDI_UNIQUE, 0,op,"Nothing to drop."); | | if (!did_one) new_draw_info(NDI_UNIQUE, 0,op,"Nothing to drop."); |
| | if (missed==1) |
| | new_draw_info(NDI_UNIQUE, 0,op, |
| | "One item couldn't be dropped because it was locked."); |
| | else if (missed>1) |
| | new_draw_info_format(NDI_UNIQUE, 0, op, |
| | "%d items couldn't be dropped because they were locked.",missed); |
} | | } |
if (op->type==PLAYER) | | if (op->type==PLAYER) |
{ | | { |
op->contr->count=0; | | op->contr->count=0; |
op->contr->socket.update_look=1; | | op->contr->socket.update_look=1; |
}; | | } |
/* draw_look(op);*/ | | /* draw_look(op);*/ |
return 0; | | return 0; |
} | | } |