version 1.2 | | version 1.3 |
---|
| | |
/* | | /* |
* static char *rcsid_pets_c = | | * static char *rcsid_pets_c = |
* "$Id: pets.c,v 1.2 1999/07/13 06:03:04 cvs Exp $"; | | * "$Id: pets.c,v 1.3 2000/05/26 09:50:49 jec Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
LOG(llevDebug,"Entering pending %s in %s\n",obl->ob->name,map->path); | | LOG(llevDebug,"Entering pending %s in %s\n",obl->ob->name,map->path); |
if(obl->ob->type == PLAYER) { | | if(obl->ob->type == PLAYER) { |
fix_player(obl->ob); | | fix_player(obl->ob); |
insert_ob_in_map(obl->ob,map); | | insert_ob_in_map(obl->ob,map,NULL); |
} | | } |
if (obl->ob->arch != NULL && obl->ob->type != PLAYER) { | | if (obl->ob->arch != NULL && obl->ob->type != PLAYER) { |
obl->ob->speed = obl->ob->arch->clone.speed; | | obl->ob->speed = obl->ob->arch->clone.speed; |
| | |
follow_owner(obl->ob,owner); | | follow_owner(obl->ob,owner); |
if(QUERY_FLAG(obl->ob, FLAG_REMOVED)) { | | if(QUERY_FLAG(obl->ob, FLAG_REMOVED)) { |
LOG(llevDebug,"follow_owner didn't help.\n"); | | LOG(llevDebug,"follow_owner didn't help.\n"); |
insert_ob_in_map(obl->ob,map); | | insert_ob_in_map(obl->ob,map,NULL); |
} | | } |
free(obl); | | free(obl); |
} | | } |
| | |
tmp->x = owner->x + freearr_x[dir]+(tmp->arch==NULL?0:tmp->arch->clone.x); | | tmp->x = owner->x + freearr_x[dir]+(tmp->arch==NULL?0:tmp->arch->clone.x); |
tmp->y = owner->y + freearr_y[dir]+(tmp->arch==NULL?0:tmp->arch->clone.y); | | tmp->y = owner->y + freearr_y[dir]+(tmp->arch==NULL?0:tmp->arch->clone.y); |
} | | } |
insert_ob_in_map(ob, owner->map); | | insert_ob_in_map(ob, owner->map, NULL); |
if (owner->type == PLAYER) /* Uh, I hope this is always true... */ | | if (owner->type == PLAYER) /* Uh, I hope this is always true... */ |
new_draw_info(NDI_UNIQUE, 0,ob->owner, "Your pet magically appears next to you"); | | new_draw_info(NDI_UNIQUE, 0,ob->owner, "Your pet magically appears next to you"); |
return; | | return; |
| | |
dir = find_dir_2(ob->x - ob->owner->x, ob->y - ob->owner->y); | | dir = find_dir_2(ob->x - ob->owner->x, ob->y - ob->owner->y); |
ob->direction = dir; | | ob->direction = dir; |
| | |
if (!(move_ob(ob, dir))) { | | if (!(move_ob(ob, dir,ob))) { |
object *part; | | object *part; |
for(part = ob; part != NULL; part = part->more) | | for(part = ob; part != NULL; part = part->more) |
{ | | { |
| | |
} | | } |
} | | } |
dir = absdir(dir + 4 - (RANDOM() %5) - (RANDOM()%5)); | | dir = absdir(dir + 4 - (RANDOM() %5) - (RANDOM()%5)); |
(void) move_ob(ob, dir); | | (void) move_ob(ob, dir, ob); |
} | | } |
return; | | return; |
} | | } |