Difference for server/c_object.c from version 1.77 to 1.78


version 1.77 version 1.78
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_c_object_c =   * static char *rcsid_c_object_c =
  *   "$Id: c_object.c,v 1.77 2006/02/07 07:54:46 mwedel Exp $";   *   "$Id: c_object.c,v 1.78 2006/03/14 15:25:24 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 54
 
Line 54
    last->ob=(NEW);\     last->ob=(NEW);\
           last->id=(COUNT);            last->id=(COUNT);
   
 /* Search the inventory of 'pl' for what matches best with params.  /**
    * Search the inventory of 'pl' for what matches best with params.
  * we use item_matched_string above - this gives us consistent behaviour   * we use item_matched_string above - this gives us consistent behaviour
  * between many commands.  Return the best match, or NULL if no match.   * between many commands.  Return the best match, or NULL if no match.
  */   * aflag is used with apply -u , and apply -a to
 object *find_best_object_match(object *pl, const char *params)  
 {  
     object *tmp, *best=NULL;  
     int match_val=0,tmpmatch;  
   
     for (tmp=pl->inv; tmp; tmp=tmp->below) {  
  if (tmp->invisible) continue;  
  if ((tmpmatch=item_matched_string(pl, tmp, params))>match_val) {  
      match_val=tmpmatch;  
      best=tmp;  
  }  
     }  
     return best;  
 }  
 /* Simlilar to find_best_object_match , but accepts an  
  * additional parameter for apply -u , and apply -a to  
  * only unapply applied , or apply unapplied objects   * only unapply applied , or apply unapplied objects
  */   **/
 static object *find_best_apply_object_match(object *pl, char *params, enum apply_flag aflag)  static object *find_best_apply_object_match(object *pl, const char *params, enum apply_flag aflag)
 {  {
     object *tmp, *best=NULL;      object *tmp, *best=NULL;
     int match_val=0,tmpmatch;      int match_val=0,tmpmatch;
Line 93
 
Line 78
     return best;      return best;
 }  }
   
   /**
    * Shortcut to find_best_apply_object_match(pl, params, AF_NULL);
    **/
   object *find_best_object_match(object *pl, const char *params)
   {
       return find_best_apply_object_match(pl, params, AP_NULL);
   }
   
 /*  /*
  * Notes about item creation:   * Notes about item creation:
  * 1) It is similar in syntax to the dm create command.   * 1) It is similar in syntax to the dm create command.


Legend:
line(s) removed in v.1.77 
line(s) changed
 line(s) added in v.1.78

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