Difference for server/monster.c from version 1.8 to 1.9


version 1.8 version 1.9
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_monster_c =   * static char *rcsid_monster_c =
  *    "$Id: monster.c,v 1.8 2000/06/22 05:56:33 cvs Exp $";   *    "$Id: monster.c,v 1.9 2000/11/20 00:59:16 peterm Exp $";
  */   */
   
 /*  /*
Line 67
 
Line 67
   return can_detect_enemy(npc,npc->enemy)?npc->enemy:NULL;    return can_detect_enemy(npc,npc->enemy)?npc->enemy:NULL;
 }  }
   
   object *find_nearest_living_creature(object *npc) {
       int i,max=SIZEOFFREE;
     int nx,ny;
     int x, y;
     mapstruct *m;
     object *tmp;
   
     x = npc->x;
     y = npc->y;
     m = npc->map;
   
     for(i=(RANDOM()%8)+1;i<max;i++) {
       nx = x + freearr_x[i];
       ny = y + freearr_y[i];
       if(!out_of_map(m,nx,ny)) {
         tmp=get_map_ob(m,nx,ny);
         while(tmp!=NULL && !QUERY_FLAG(tmp,FLAG_MONSTER)&&
        !QUERY_FLAG(tmp,FLAG_GENERATOR ) && tmp->type!=PLAYER)
                   tmp=tmp->above;
         if(tmp!=NULL && can_see_monsterP(m,x,y,i))
           return tmp;
       }
     }
     return 0;  /* nothing found */
   }
   
   
 object *find_enemy(object *npc) {  object *find_enemy(object *npc) {
   object *tmp=NULL;    object *tmp=NULL;
   
     if(QUERY_FLAG(npc,FLAG_BERSERK)) {
       return find_nearest_living_creature(npc);
     }
   if ((npc->move_type & HI4) == PETMOVE)    if ((npc->move_type & HI4) == PETMOVE)
     return get_pet_enemy(npc);      return get_pet_enemy(npc);
   if((tmp=get_enemy(npc))==NULL)    if((tmp=get_enemy(npc))==NULL)


Legend:
line(s) removed in v.1.8 
line(s) changed
 line(s) added in v.1.9

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:38