version 1.88 | | version 1.89 |
---|
| | |
/* | | /* |
* static char *rcsid_c_object_c = | | * static char *rcsid_c_object_c = |
* "$Id: c_object.c,v 1.88 2006/09/09 20:31:31 qal21 Exp $"; | | * "$Id: c_object.c,v 1.89 2006/09/10 00:04:35 qal21 Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| | |
| | |
if ( !QUERY_FLAG(tmp, FLAG_UNPAID) && tmp->type != MONEY ) { | | if ( !QUERY_FLAG(tmp, FLAG_UNPAID) && tmp->type != MONEY ) { |
floor = get_map_ob (op->map, op->x, op->y); | | if (is_in_shop(op)) |
while ( floor && floor->type != SHOP_FLOOR ) | | |
floor = floor->above; | | |
if ( floor ) | | |
sell_item(tmp,op); | | sell_item(tmp,op); |
} | | } |
| | |
| | |
| | |
void examine(object *op, object *tmp) { | | void examine(object *op, object *tmp) { |
char buf[VERY_BIG_BUF]; | | char buf[VERY_BIG_BUF]; |
| | int in_shop; |
int i; | | int i; |
| | |
if (tmp == NULL || tmp->type == CLOSE_CON) | | if (tmp == NULL || tmp->type == CLOSE_CON) |
| | |
new_draw_info(NDI_UNIQUE, 0,op,buf); | | new_draw_info(NDI_UNIQUE, 0,op,buf); |
} | | } |
| | |
| | in_shop = is_in_shop(op); |
| | |
if (tmp->value && !QUERY_FLAG(tmp, FLAG_STARTEQUIP) && !QUERY_FLAG(tmp, FLAG_NO_PICK)) { | | if (tmp->value && !QUERY_FLAG(tmp, FLAG_STARTEQUIP) && !QUERY_FLAG(tmp, FLAG_NO_PICK)) { |
object *floor; | | |
sprintf(buf,"You reckon %s worth %s.", | | sprintf(buf,"You reckon %s worth %s.", |
tmp->nrof>1?"they are":"it is",query_cost_string(tmp,op,F_SELL | F_APPROX)); | | tmp->nrof>1?"they are":"it is",query_cost_string(tmp,op,F_SELL | F_APPROX)); |
new_draw_info(NDI_UNIQUE, 0,op,buf); | | new_draw_info(NDI_UNIQUE, 0,op,buf); |
floor = get_map_ob (op->map, op->x, op->y); | | if (in_shop) { |
if (floor && floor->type == SHOP_FLOOR) { | | |
if(QUERY_FLAG(tmp, FLAG_UNPAID)) | | if(QUERY_FLAG(tmp, FLAG_UNPAID)) |
sprintf(buf,"%s would cost you %s.", | | sprintf(buf,"%s would cost you %s.", |
tmp->nrof>1?"They":"It",query_cost_string(tmp,op,F_BUY | F_SHOP)); | | tmp->nrof>1?"They":"It",query_cost_string(tmp,op,F_BUY | F_SHOP)); |