version 1.136 | | version 1.137 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.136 2006/07/28 06:45:29 qal21 Exp $"; | | * "$Id: object.c,v 1.137 2006/07/29 09:29:15 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* drop on that space. | | * drop on that space. |
*/ | | */ |
if (free_inventory || ob->map==NULL || ob->map->in_memory!=MAP_IN_MEMORY || | | if (free_inventory || ob->map==NULL || ob->map->in_memory!=MAP_IN_MEMORY || |
(GET_MAP_MOVE_BLOCK(ob->map, ob->x, ob->y) == MOVE_ALL)) | | (GET_MAP_MOVE_BLOCK(ob->map, ob->x, ob->y) == MOVE_ALL)) { |
{ | | |
op=ob->inv; | | op=ob->inv; |
while(op!=NULL) { | | while(op!=NULL) { |
tmp=op->below; | | tmp=op->below; |
| | |
op->type==RUNE || op->type==TRAP || QUERY_FLAG(op,FLAG_IS_A_TEMPLATE)) | | op->type==RUNE || op->type==TRAP || QUERY_FLAG(op,FLAG_IS_A_TEMPLATE)) |
free_object(op); | | free_object(op); |
else { | | else { |
| | if ( QUERY_FLAG(op,FLAG_ALIVE) ) { |
| | int pos = find_free_spot(op,ob->map,ob->x, ob->y, 0, SIZEOFFREE); |
| | if ( pos == -1 ) |
| | free_object(op); |
| | else { |
| | op->x=ob->x + freearr_x[ pos ]; |
| | op->y=ob->y + freearr_y[ pos ]; |
| | insert_ob_in_map(op,ob->map,NULL,0); /* Insert in same map as the envir */ |
| | } |
| | } |
| | else { |
op->x=ob->x; | | op->x=ob->x; |
op->y=ob->y; | | op->y=ob->y; |
insert_ob_in_map(op,ob->map,NULL,0); /* Insert in same map as the envir */ | | insert_ob_in_map(op,ob->map,NULL,0); /* Insert in same map as the envir */ |
} | | } |
| | } |
op=tmp; | | op=tmp; |
} | | } |
} | | } |