version 1.51 | | version 1.52 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.51 2002/09/06 04:44:46 mwedel Exp $"; | | * "$Id: monster.c,v 1.52 2002/09/07 21:30:45 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
else if (!QUERY_FLAG(npc, FLAG_FRIENDLY) && | | else if (!QUERY_FLAG(npc, FLAG_FRIENDLY) && |
(!QUERY_FLAG(npc->enemy, FLAG_FRIENDLY) && npc->enemy->type!=PLAYER)) | | (!QUERY_FLAG(npc->enemy, FLAG_FRIENDLY) && npc->enemy->type!=PLAYER)) |
npc->enemy=NULL; | | npc->enemy=NULL; |
| | |
| | /* I've noticed that pets could sometimes get an arrow as the |
| | * target enemy - this code below makes sure the enemy is something |
| | * that should be attacked. My guess is that the arrow hits |
| | * the creature/owner, and so the creature then takes that |
| | * as the enemy to attack. |
| | */ |
| | else if (!QUERY_FLAG(npc->enemy, FLAG_MONSTER) && |
| | !QUERY_FLAG(npc->enemy,FLAG_GENERATOR ) && npc->type!=PLAYER) |
| | npc->enemy=NULL; |
| | |
} | | } |
return can_detect_enemy(npc,npc->enemy,rv)?npc->enemy:NULL; | | return can_detect_enemy(npc,npc->enemy,rv)?npc->enemy:NULL; |
} | | } |