version 1.34 | | version 1.35 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.34 2001/01/15 07:11:39 cvs Exp $"; | | * "$Id: player.c,v 1.35 2001/01/17 06:15:25 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); |
add_friendly_object(p->ob); | | add_friendly_object(p->ob); |
#ifdef MOTD | | #ifdef MOTD |
display_motd(p->ob); | | display_motd(p->ob); |
| | |
* While unlikely, it is possible the next object on the friendly | | * While unlikely, it is possible the next object on the friendly |
* list is also free, so encapsulate this in a while loop. | | * list is also free, so encapsulate this in a while loop. |
*/ | | */ |
while (QUERY_FLAG(ol->ob, FLAG_FREED)) { | | while (QUERY_FLAG(ol->ob, FLAG_FREED) || !QUERY_FLAG(ol->ob, FLAG_FRIENDLY)) { |
object *tmp=ol->ob; | | object *tmp=ol->ob; |
| | |
/* Can't do much more other than log the fact, because the object | | /* Can't do much more other than log the fact, because the object |
* itself will have been cleared. | | * itself will have been cleared. |
*/ | | */ |
LOG(llevDebug,"get_nearest_player: Found free object on friendly list\n"); | | LOG(llevDebug,"get_nearest_player: Found free/non friendly object on friendly list\n"); |
ol = ol->next; | | ol = ol->next; |
remove_friendly_object(tmp); | | remove_friendly_object(tmp); |
if (!ol) return op; | | if (!ol) return op; |