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


version 1.78 version 1.79
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_c_object_c =   * static char *rcsid_c_object_c =
  *   "$Id: c_object.c,v 1.78 2006/03/14 15:25:24 ryo_saeba Exp $";   *   "$Id: c_object.c,v 1.79 2006/05/05 09:47:40 ryo_saeba Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 35
 
Line 35
 #endif  #endif
 #include <living.h>  #include <living.h>
 #include <math.h>  #include <math.h>
   
   static void set_pickup_mode(const object *op, int i);
   
 /*  /*
  * Object id parsing functions   * Object id parsing functions
  */   */
Line 42
 
Line 45
 #define OBLINKMALLOC(p) if(!((p)=(objectlink *)malloc(sizeof(objectlink))))\  #define OBLINKMALLOC(p) if(!((p)=(objectlink *)malloc(sizeof(objectlink))))\
                           fatal(OUT_OF_MEMORY);                            fatal(OUT_OF_MEMORY);
   
 #define ADD_ITEM(NEW,COUNT)\  
    if(!first) {\  
      OBLINKMALLOC(first);\  
      last=first;\  
    } else {\  
      OBLINKMALLOC(last->next);\  
      last=last->next;\  
    }\  
    last->next=NULL;\  
    last->ob=(NEW);\  
           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
Line 81
 
Line 72
 /**  /**
  * Shortcut to find_best_apply_object_match(pl, params, AF_NULL);   * Shortcut to find_best_apply_object_match(pl, params, AF_NULL);
  **/   **/
 object *find_best_object_match(object *pl, const char *params)  static object *find_best_object_match(object *pl, const char *params)
 {  {
     return find_best_apply_object_match(pl, params, AP_NULL);      return find_best_apply_object_match(pl, params, AP_NULL);
 }  }
Line 495
 
Line 486
  * certain number of objects to drop, so we can pass that number, and   * certain number of objects to drop, so we can pass that number, and
  * not need to use split_ob and stuff.   * not need to use split_ob and stuff.
  */   */
 int sack_can_hold (object *pl, object *sack, object *op, uint32 nrof) {  int sack_can_hold(const object *pl, const object *sack, const object *op, uint32 nrof) {
   
     if (! QUERY_FLAG (sack, FLAG_APPLIED)) {      if (! QUERY_FLAG (sack, FLAG_APPLIED)) {
  new_draw_info_format(NDI_UNIQUE, 0, pl,    new_draw_info_format(NDI_UNIQUE, 0, pl,
Line 1355
 
Line 1346
   
   
 /* tmp is the object being described, pl is who is examing it. */  /* tmp is the object being described, pl is who is examing it. */
 char *long_desc(object *tmp, object *pl) {  const char *long_desc(const object *tmp, const object *pl) {
     static char buf[VERY_BIG_BUF];      static char buf[VERY_BIG_BUF];
     char *cp;      char *cp;
   
Line 1543
 
Line 1534
  */   */
 void inventory(object *op,object *inv) {  void inventory(object *op,object *inv) {
   object *tmp;    object *tmp;
   char *in;    const char *in;
   int items = 0, length;    int items = 0, length;
   
   if (inv==NULL && op==NULL) {    if (inv==NULL && op==NULL) {
Line 1596
 
Line 1587
   }    }
 }  }
   
 static void display_new_pickup( object* op )  static void display_new_pickup(const object* op)
     {      {
     int i = op->contr->mode;      int i = op->contr->mode;
   
Line 1703
 
Line 1694
   return 1;    return 1;
 }  }
   
 void set_pickup_mode(object *op,int i) {  static void set_pickup_mode(const object *op, int i) {
   switch(op->contr->mode=i) {    switch(op->contr->mode=i) {
     case 0:      case 0:
       new_draw_info(NDI_UNIQUE, 0,op,"Mode: Don't pick up.");        new_draw_info(NDI_UNIQUE, 0,op,"Mode: Don't pick up.");


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

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