Difference for server/shop.c from version 1.41 to 1.42


version 1.41 version 1.42
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_shop_c =   * static char *rcsid_shop_c =
  *   "$Id: shop.c,v 1.41 2005/10/04 04:39:19 cavesomething Exp $";   *   "$Id: shop.c,v 1.42 2005/10/04 17:16:05 ryo_saeba Exp $";
  */   */
   
 /*  /*
Line 248
 
Line 248
    * (we need a +1 there in case we would otherwise be dividing by zero.     * (we need a +1 there in case we would otherwise be dividing by zero.
    */     */
  if (approximate)    if (approximate)
      val = val + (sint64)(val*(sin(tmp->count)/sqrt(lev_bargain+lev_identify*2+1.0)));       val = (sint64)val + (sint64)((sint64)val*(sin(tmp->count)/sqrt(lev_bargain+lev_identify*2+1.0)));
     }      }
         
     /* I don't think this should really happen - if it does, it indicates and      /* I don't think this should really happen - if it does, it indicates and
Line 267
 
Line 267
     /* if we are in a shop, check how the type of shop should affect the price */      /* if we are in a shop, check how the type of shop should affect the price */
     if (shop) {      if (shop) {
  if (flag==F_SELL)    if (flag==F_SELL)
      val=val*shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who)       val=(sint64)val*shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who)
  /shop_greed(who->map);   /shop_greed(who->map);
  else if (flag==F_BUY) {   else if (flag==F_BUY) {
  /*    /*
Line 284
 
Line 284
  * antiques in a junk shop in real life).   * antiques in a junk shop in real life).
  */   */
      if (QUERY_FLAG(tmp, FLAG_PLAYER_SOLD))       if (QUERY_FLAG(tmp, FLAG_PLAYER_SOLD))
  val=val*shop_greed(who->map)*shop_specialisation_ratio(tmp, who->map)   val=(sint64)val*shop_greed(who->map)*shop_specialisation_ratio(tmp, who->map)
      /shopkeeper_approval(who->map, who);       /shopkeeper_approval(who->map, who);
      else       else
  val=val*shop_greed(who->map)   val=(sint64)val*shop_greed(who->map)
      /(shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who));       /(shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who));
  }   }
  /* we will also have an extra 0-5% variation between shops of the same type    /* we will also have an extra 0-5% variation between shops of the same type
Line 295
 
Line 295
  * pointful, and could give fun with rounding.   * pointful, and could give fun with rounding.
  */   */
  if(who->map->path!=NULL && val > 50)   if(who->map->path!=NULL && val > 50)
      val=val+0.05*val*cos(tmp->count+strlen(who->map->path));       val=(sint64)val+0.05*(sint64)val*cos(tmp->count+strlen(who->map->path));
     }      }
     return val;      return val;
 }  }
Line 934
 
Line 934
     }      }
     else new_draw_info(NDI_UNIQUE,0,op,"There is no shop nearby.");      else new_draw_info(NDI_UNIQUE,0,op,"There is no shop nearby.");
   
       return 1;
 }  }
 typedef struct shopinv {  typedef struct shopinv {
     char *item_sort;      char *item_sort;


Legend:
line(s) removed in v.1.41 
line(s) changed
 line(s) added in v.1.42

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