version 1.41 | | version 1.42 |
---|
| | |
/* | | /* |
* static char *rcsid_c_object_c = | | * static char *rcsid_c_object_c = |
* "$Id: c_object.c,v 1.41 2002/11/26 08:48:20 garbled Exp $"; | | * "$Id: c_object.c,v 1.42 2002/12/01 03:46:25 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
} | | } |
| | |
| | |
| | /* This takes (picks up) and item. op is the player |
| | * who issued the command. params is a string to |
| | * match against the item name. Basically, always |
| | * returns zero, but that should be improved. |
| | */ |
int command_take (object *op, char *params) | | int command_take (object *op, char *params) |
{ | | { |
object *tmp, *next; | | object *tmp, *next; |
| | |
if (op->container) | | if (op->container) |
tmp=op->container; | | tmp=op->container->inv; |
else { | | else { |
tmp=op->above; | | tmp=op->above; |
if (tmp) while (tmp->above) { | | if (tmp) while (tmp->above) { |
| | |
break; | | break; |
} | | } |
tmp=next; | | tmp=next; |
| | /* Might as well just skip over the player immediately - |
| | * we know it can't be picked up |
| | */ |
| | if (tmp == op) tmp=tmp->below; |
} | | } |
if (!params && !tmp) { | | if (!params && !tmp) { |
for (tmp=op->below; tmp!=NULL; tmp=tmp->next) | | for (tmp=op->below; tmp!=NULL; tmp=tmp->next) |
| | |
} | | } |
if (!tmp) new_draw_info(NDI_UNIQUE, 0,op, "There is nothing to pick up."); | | if (!tmp) new_draw_info(NDI_UNIQUE, 0,op, "There is nothing to pick up."); |
} | | } |
| | |
/* Shouldn't be needed - pick_up should update this */ | | |
/* draw_look(op);*/ | | |
return 0; | | return 0; |
} | | } |
| | |