version 1.13 | | version 1.14 |
---|
| | |
/* | | /* |
* static char *rcsid_pets_c = | | * static char *rcsid_pets_c = |
* "$Id: pets.c,v 1.13 2002/09/01 06:32:31 mwedel Exp $"; | | * "$Id: pets.c,v 1.14 2002/09/24 05:43:15 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
void pet_move(object * ob) | | void pet_move(object * ob) |
{ | | { |
int dir,tag; | | int dir,tag, dx, dy; |
object *ob2, *owner; | | object *ob2, *owner; |
| | mapstruct *m; |
| | |
/* Check to see if player pulled out */ | | /* Check to see if player pulled out */ |
if ((owner = get_owner(ob)) == NULL) { | | if ((owner = get_owner(ob)) == NULL) { |
| | |
| | |
for(part = ob; part != NULL; part = part->more) | | for(part = ob; part != NULL; part = part->more) |
{ | | { |
for (ob2 = get_map_ob(part->map, part->x + freearr_x[dir], | | dx = part->x + freearr_x[dir]; |
part->y + freearr_y[dir]); ob2 != NULL; ob2 = ob2->above) | | dy = part->y + freearr_y[dir]; |
| | m = get_map_from_coord(part->map, &dx, &dy); |
| | if (!m) continue; |
| | |
| | for (ob2 = get_map_ob(m, dx, dy); ob2 != NULL; ob2 = ob2->above) |
{ | | { |
object *new_ob; | | object *new_ob; |
new_ob = ob2->head?ob2->head:ob2; | | new_ob = ob2->head?ob2->head:ob2; |