| version 1.58 | | version 1.59 |
|---|
| | |
| /* | | /* |
| * static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
| * "$Id: shop.c,v 1.58 2006/09/06 21:58:00 lalo Exp $"; | | * "$Id: shop.c,v 1.59 2006/09/09 23:43:12 qal21 Exp $"; |
| */ | | */ |
| | | |
| /* | | /* |
| | |
| } | | } |
| free(items); | | free(items); |
| } | | } |
| | | |
| | | /* Check if an object is in a shop. Returns 1 if so, 0 otherwise. */ |
| | | int is_in_shop(object *ob) { |
| | | if (!ob->map) |
| | | return 0; |
| | | return coords_in_shop(ob->map, ob->x, ob->y); |
| | | } |
| | | |
| | | /* Check if given map coords are in a shop. Returns 1 if so, 0 otherwise. */ |
| | | int coords_in_shop(mapstruct *map, int x, int y) { |
| | | object *floor; |
| | | for (floor = get_map_ob (map, x, y); floor; floor = floor->above) |
| | | if (floor->type == SHOP_FLOOR) |
| | | return 1; |
| | | return 0; |
| | | } |