version 1.13 | | version 1.14 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.13 2000/12/24 01:48:20 cvs Exp $"; | | * "$Id: monster.c,v 1.14 2001/01/11 09:37:02 pjka Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
void communicate(object *op, char *txt) { | | void communicate(object *op, char *txt) { |
object *npc; | | object *npc; |
int i; | | int i; |
| | int flag=1; /*hasn't spoken to a NPC yet*/ |
for(i = 0; i <= SIZEOFFREE2; i++) | | for(i = 0; i <= SIZEOFFREE2; i++) |
if (!out_of_map(op->map, op->x+freearr_x[i], op->y+freearr_y[i])) | | if (!out_of_map(op->map, op->x+freearr_x[i], op->y+freearr_y[i])) |
for(npc = get_map_ob(op->map,op->x+freearr_x[i],op->y+freearr_y[i]); | | for(npc = get_map_ob(op->map,op->x+freearr_x[i],op->y+freearr_y[i]); |
npc != NULL; npc = npc->above) { | | npc != NULL; npc = npc->above) { |
if (npc->type == MAGIC_EAR) | | if (npc->type == MAGIC_EAR) |
(void) talk_to_wall(npc, txt); /* Maybe exit after 1. success? */ | | (void) talk_to_wall(npc, txt); /* Maybe exit after 1. success? */ |
else | | else if(flag) { |
if (talk_to_npc(npc,txt)) | | if (talk_to_npc(npc,txt)) |
return; /* Can be crowded */ | | flag=0; /* Can be crowded */ |
| | } |
} | | } |
} | | } |
| | |