Difference for server/c_object.c from version 1.5 to 1.6


version 1.5 version 1.6
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_c_object_c =   * static char *rcsid_c_object_c =
  *   "$Id: c_object.c,v 1.5 2000/05/26 09:50:49 jec Exp $";   *   "$Id: c_object.c,v 1.6 2000/06/08 16:08:41 jec Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 322
 
Line 322
   
     if(nrof != tmp->nrof && !(nrof == 1 && tmp->nrof == 0)) {      if(nrof != tmp->nrof && !(nrof == 1 && tmp->nrof == 0)) {
  object *tmp2 = tmp;   object *tmp2 = tmp;
           tag_t tmp2_tag = tmp2->count;
  tmp = get_split_ob (tmp, nrof);   tmp = get_split_ob (tmp, nrof);
  if(!tmp) {   if(!tmp) {
      new_draw_info(NDI_UNIQUE, 0,pl, errmsg);       new_draw_info(NDI_UNIQUE, 0,pl, errmsg);
Line 329
 
Line 330
  }   }
  /* Tell a client what happened rest of objects */   /* Tell a client what happened rest of objects */
  if (pl->type == PLAYER) {   if (pl->type == PLAYER) {
      if (QUERY_FLAG(tmp2, FLAG_REMOVED))              if (was_destroyed (tmp2, tmp2_tag))
  esrv_del_item (pl->contr, tmp2->count);   esrv_del_item (pl->contr, tmp2_tag);
      else       else
  esrv_send_item (pl, tmp2);   esrv_send_item (pl, tmp2);
  }   }
Line 483
 
Line 484
  */   */
 void put_object_in_sack (object *op, object *sack, object *tmp, long nrof)   void put_object_in_sack (object *op, object *sack, object *tmp, long nrof)
 {  {
       tag_t tmp_tag, tmp2_tag;
     object *tmp2, *sack2;      object *tmp2, *sack2;
     char buf[MAX_BUF];      char buf[MAX_BUF];
   
Line 536
 
Line 538
     /* we want to put some portion of the item into the container */      /* we want to put some portion of the item into the container */
     if (nrof && tmp->nrof != nrof) {      if (nrof && tmp->nrof != nrof) {
  object *tmp2 = tmp;   object *tmp2 = tmp;
           tmp2_tag = tmp2->count;
  tmp = get_split_ob (tmp, nrof);   tmp = get_split_ob (tmp, nrof);
   
  if(!tmp) {   if(!tmp) {
Line 543
 
Line 546
      return;       return;
  }   }
  /* Tell a client what happened other objects */    /* Tell a client what happened other objects */
  if (QUERY_FLAG(tmp2, FLAG_FREED))   if (was_destroyed (tmp2, tmp2_tag))
        esrv_del_item (op->contr, tmp2->count);         esrv_del_item (op->contr, tmp2_tag);
  else /* this can proably be replaced with an update */   else /* this can proably be replaced with an update */
        esrv_send_item (op, tmp2);         esrv_send_item (op, tmp2);
     } else      } else
Line 553
 
Line 556
     sprintf(buf, "You put %s in ", query_name(tmp));      sprintf(buf, "You put %s in ", query_name(tmp));
     strcat (buf, query_name(sack));      strcat (buf, query_name(sack));
     strcat (buf, ".");      strcat (buf, ".");
       tmp_tag = tmp->count;
     tmp2 = insert_ob_in_ob(tmp, sack);      tmp2 = insert_ob_in_ob(tmp, sack);
     new_draw_info(NDI_UNIQUE, 0,op,buf);      new_draw_info(NDI_UNIQUE, 0,op,buf);
     fix_player(op); /* This is overkill, fix_player() is called somewhere */       fix_player(op); /* This is overkill, fix_player() is called somewhere */
Line 562
 
Line 566
      * delete the original.       * delete the original.
      */       */
     if (tmp2 != tmp)       if (tmp2 != tmp)
  esrv_del_item (op->contr, tmp->count);   esrv_del_item (op->contr, tmp_tag);
            
     esrv_send_item (op, tmp2);      esrv_send_item (op, tmp2);
     /* update the sacks and players weight */      /* update the sacks and players weight */
Line 604
 
Line 608
      */       */
     if(nrof && tmp->nrof != nrof) {      if(nrof && tmp->nrof != nrof) {
  object *tmp2 = tmp;   object *tmp2 = tmp;
           tag_t tmp2_tag = tmp2->count;
  tmp = get_split_ob (tmp, nrof);   tmp = get_split_ob (tmp, nrof);
  if(!tmp) {   if(!tmp) {
      new_draw_info(NDI_UNIQUE, 0,op, errmsg);       new_draw_info(NDI_UNIQUE, 0,op, errmsg);
Line 612
 
Line 617
  /* Tell a client what happened rest of objects.  tmp2 is now the   /* Tell a client what happened rest of objects.  tmp2 is now the
  * original object   * original object
  */    */
  if (QUERY_FLAG(tmp2, FLAG_FREED))   if (was_destroyed (tmp2, tmp2_tag))
        esrv_del_item (op->contr, tmp2->count);         esrv_del_item (op->contr, tmp2_tag);
  else   else
        esrv_send_item (op, tmp2);         esrv_send_item (op, tmp2);
     } else      } else


Legend:
line(s) removed in v.1.5 
line(s) changed
 line(s) added in v.1.6

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