version 1.16 | | version 1.17 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_item_c = | | * static char *rcsid_item_c = |
* "$Id: item.c,v 1.16 2001/06/04 06:41:02 mwedel Exp $"; | | * "$Id: item.c,v 1.17 2001/08/21 05:39:31 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
*/ | | */ |
void look_at(object *op,int dx,int dy) { | | void look_at(object *op,int dx,int dy) { |
object *tmp; | | object *tmp; |
int flag=0; | | int flag=0,x,y; |
| | mapstruct *m; |
| | |
| | |
if (out_of_map(op->map, op->x+dx, op->y+dy)) return; | | if (out_of_map(op->map, op->x+dx, op->y+dy)) return; |
#if 0 | | |
/* put player back on top */ | | x = op->x + dx; |
if(op->above!=NULL) { | | y = op->y + dy; |
SET_FLAG (op, FLAG_NO_APPLY); | | |
remove_ob(op); | | m = get_map_from_coord(op->map, &x, &y); |
insert_ob_in_map(op,op->map,NULL); | | if (!m) return; |
CLEAR_FLAG (op, FLAG_NO_APPLY); | | |
} | | for(tmp=get_map_ob(m, x ,y);tmp!=NULL&&tmp->above!=NULL; |
/* find top object to process from */ | | |
if(dx||dy) | | |
for(tmp=get_map_ob(op->map,op->x+dx,op->y+dy);tmp!=NULL&&tmp->above!=NULL; | | |
tmp=tmp->above); | | |
else | | |
tmp=op->below; | | |
#else | | |
for(tmp=get_map_ob(op->map,op->x+dx,op->y+dy);tmp!=NULL&&tmp->above!=NULL; | | |
tmp=tmp->above); | | tmp=tmp->above); |
#endif | | |
for ( ; tmp != NULL; tmp=tmp->below ) { | | for ( ; tmp != NULL; tmp=tmp->below ) { |
if (tmp->invisible && !QUERY_FLAG(op, FLAG_WIZ)) continue; | | if (tmp->invisible && !QUERY_FLAG(op, FLAG_WIZ)) continue; |
| | |