Difference for server/c_object.c from version 1.2 to 1.3


version 1.2 version 1.3
Line 257
 
Line 257
     if (op->type == SPECIAL_KEY && sack->slaying && op->slaying)      if (op->type == SPECIAL_KEY && sack->slaying && op->slaying)
  sprintf (buf, "You don't want put the key into %s.", query_name(sack));   sprintf (buf, "You don't want put the key into %s.", query_name(sack));
     if (sack->weight_limit && sack->carrying + (nrof ? nrof : 1) *       if (sack->weight_limit && sack->carrying + (nrof ? nrof : 1) *
  op->weight * (100 - sack->stats.Str) / 100  > sack->weight_limit)   (op->weight + (op->type==CONTAINER?(op->carrying*op->stats.Str):0))
    * (100 - sack->stats.Str) / 100  > sack->weight_limit)
  sprintf (buf, "That won't fit in %s!", query_name(sack));   sprintf (buf, "That won't fit in %s!", query_name(sack));
     if (buf[0]) {      if (buf[0]) {
  if (pl)   if (pl)
Line 307
 
Line 308
  free_object(tmp);   free_object(tmp);
  return;   return;
     }      }
       if (nrof==0 || nrof>tmp->nrof) nrof=(tmp->nrof?tmp->nrof:1);
     /* Figure out how much weight this object will add to the player */      /* Figure out how much weight this object will add to the player */
     weight = tmp->weight;      weight = tmp->weight * nrof;
     if (nrof) weight *=nrof;      if (tmp->inv) weight += tmp->carrying * (100 - tmp->stats.Str) / 100;
     else if (tmp->nrof) weight *= tmp->nrof;  
     if (op->type == CONTAINER) weight = weight * (100 - op->stats.Str) / 100;  
     if ((pl->weight + pl->carrying +weight) > weight_limit[pl->stats.Str]) {      if ((pl->weight + pl->carrying +weight) > weight_limit[pl->stats.Str]) {
  new_draw_info(NDI_UNIQUE, 0,pl,"That item is too heavy for you to pick up.");   new_draw_info(NDI_UNIQUE, 0,pl,"That item is too heavy for you to pick up.");
  return;   return;
Line 323
 
Line 323
  SET_FLAG(tmp, FLAG_WAS_WIZ);   SET_FLAG(tmp, FLAG_WAS_WIZ);
 #endif  #endif
   
     if(nrof && nrof != tmp->nrof) {      if(nrof != tmp->nrof && !(nrof == 1 && tmp->nrof == 0)) {
  object *tmp2 = tmp;   object *tmp2 = tmp;
  tmp = get_split_ob (tmp, nrof);   tmp = get_split_ob (tmp, nrof);
  if(!tmp) {   if(!tmp) {
Line 480
 
Line 480
  */   */
 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)
 {  {
     object *tmp2;      object *tmp2, *sack2;
     char buf[MAX_BUF];      char buf[MAX_BUF];
   
     if (sack==tmp) return; /* Can't put an object in itself */      if (sack==tmp) return; /* Can't put an object in itself */
Line 500
 
Line 500
        * we instead move the contents of that container into the active         * we instead move the contents of that container into the active
        * container, this is only done if the object has something in it.          * container, this is only done if the object has something in it.
        */         */
         sack2 = tmp;
       sprintf (buf, "You move the items from %s into ", query_name(tmp));        new_draw_info_format(NDI_UNIQUE, 0,op, "You move the items from %s into %s.",
       strcat (buf,  query_name(op->container));       query_name(tmp), query_name(op->container));
       strcat (buf, ".");  
       new_draw_info(NDI_UNIQUE, 0,op, buf);  
       for (tmp2 = tmp->inv; tmp2; tmp2 = tmp) {        for (tmp2 = tmp->inv; tmp2; tmp2 = tmp) {
    tmp = tmp2->below;     tmp = tmp2->below;
  if (sack_can_hold(op, op->container, tmp2,tmp2->nrof))   if (sack_can_hold(op, op->container, tmp2,tmp2->nrof))
Line 515
 
Line 513
    break;     break;
  }   }
       }        }
         esrv_update_item (UPD_WEIGHT, op, sack2);
       return;        return;
     }      }
   
Line 683
 
Line 682
     if (tmp->invisible) {      if (tmp->invisible) {
  /* if the following is the case, it must be in an container. */   /* if the following is the case, it must be in an container. */
  if (tmp->env && tmp->env->type != PLAYER) {   if (tmp->env && tmp->env->type != PLAYER) {
      /* Just toss the object - probably shouldn't be around       /* Just toss the object - probably shouldn't be hanging
       * around anyways        * around anyways
       */        */
      remove_ob(tmp);       remove_ob(tmp);


Legend:
line(s) removed in v.1.2 
line(s) changed
 line(s) added in v.1.3

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