Difference for common/object.c from version 1.36 to 1.37


version 1.36 version 1.37
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_object_c =   * static char *rcsid_object_c =
  *   "$Id: object.c,v 1.36 2001/08/05 05:07:20 mwedel Exp $";   *   "$Id: object.c,v 1.37 2001/08/05 22:34:04 mwedel Exp $";
  */   */
   
 /*  /*
Line 1512
 
Line 1512
 object *decrease_ob_nr (object *op, int i)  object *decrease_ob_nr (object *op, int i)
 {  {
     object *tmp;      object *tmp;
       player *pl;
   
     if (i == 0)   /* objects with op->nrof require this check */      if (i == 0)   /* objects with op->nrof require this check */
         return op;          return op;
Line 1525
 
Line 1526
     }      }
     else if (op->env != NULL)      else if (op->env != NULL)
     {      {
    /* is this object in the players inventory, or sub container
    * therein?
    */
         tmp = is_player_inv (op->env);          tmp = is_player_inv (op->env);
    /* nope.  Is this a container the player has opened?
    * If so, set tmp to that player.
    * IMO, searching through all the players will mostly
    * likely be quicker than following op->env to the map,
    * and then searching the map for a player.
    */
    if (!tmp) {
        for (pl=first_player; pl; pl=pl->next)
    if (pl->ob->container == op->env) break;
        if (pl) tmp=pl->ob;
        else tmp=NULL;
    }
   
         if (i < op->nrof) {          if (i < op->nrof) {
             sub_weight (op->env, op->weight * i);              sub_weight (op->env, op->weight * i);
             op->nrof -= i;              op->nrof -= i;


Legend:
line(s) removed in v.1.36 
line(s) changed
 line(s) added in v.1.37

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