version 1.35 | | version 1.36 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.35 2001/01/17 06:15:25 cvs Exp $"; | | * "$Id: player.c,v 1.36 2001/01/26 07:23:26 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
p->ob->name = NULL; | | p->ob->name = NULL; |
free_object(p->ob); | | free_object(p->ob); |
p->ob=get_player(p,m); | | p->ob=get_player(p,m); |
SET_FLAG(p->ob, FLAG_FRIENDLY); | | CLEAR_FLAG(p->ob, FLAG_FRIENDLY); |
add_friendly_object(p->ob); | | add_friendly_object(p->ob); |
#ifdef MOTD | | #ifdef MOTD |
display_motd(p->ob); | | display_motd(p->ob); |
| | |
| | |
object *get_nearest_player(object *mon) { | | object *get_nearest_player(object *mon) { |
object *op = NULL; | | object *op = NULL; |
| | player *pl = NULL; |
objectlink *ol; | | objectlink *ol; |
int lastdist,tmp; | | int lastdist,tmp; |
| | |
| | |
lastdist=tmp; | | lastdist=tmp; |
} | | } |
} | | } |
| | for (pl=first_player; pl != NULL; pl=pl->next) { |
| | if (pl->ob->map == mon->map && can_detect_enemy(mon, pl->ob)) { |
| | tmp=distance(pl->ob,mon); |
| | if(lastdist>tmp) { |
| | op=pl->ob; |
| | lastdist=tmp; |
| | } |
| | } |
| | } |
#if 0 | | #if 0 |
LOG(llevDebug,"get_nearest_player() finds player: %s\n",op?op->name:"(null)"); | | LOG(llevDebug,"get_nearest_player() finds player: %s\n",op?op->name:"(null)"); |
#endif | | #endif |