Restores shop item values after previous precision change.

This commit is contained in:
wyld-sw 2017-11-03 07:44:22 -04:00
parent 954d5f2639
commit 08f5eb8947
2 changed files with 5 additions and 5 deletions

View file

@ -456,15 +456,15 @@ static struct obj_data *get_purchase_obj(struct char_data *ch, char *arg, struct
static int buy_price(struct obj_data *obj, int shop_nr, struct char_data *keeper, struct char_data *buyer)
{
return (int) (GET_OBJ_COST(obj) * SHOP_BUYPROFIT(shop_nr)
* (1 + (GET_CHA(keeper) - GET_CHA(buyer)) / (double)70));
* (1 + (GET_CHA(keeper) - GET_CHA(buyer)) / (float)70));
}
/* When the shopkeeper is buying, we reverse the discount. Also make sure
we don't buy for more than we sell for, to prevent infinite money-making. */
static int sell_price(struct obj_data *obj, int shop_nr, struct char_data *keeper, struct char_data *seller)
{
float sell_cost_modifier = SHOP_SELLPROFIT(shop_nr) * (1 - (GET_CHA(keeper) - GET_CHA(seller)) / (double)70);
float buy_cost_modifier = SHOP_BUYPROFIT(shop_nr) * (1 + (GET_CHA(keeper) - GET_CHA(seller)) / (double)70);
float sell_cost_modifier = SHOP_SELLPROFIT(shop_nr) * (1 - (GET_CHA(keeper) - GET_CHA(seller)) / 70.0);
float buy_cost_modifier = SHOP_BUYPROFIT(shop_nr) * (1 + (GET_CHA(keeper) - GET_CHA(seller)) / 70.0);
if (sell_cost_modifier > buy_cost_modifier)
sell_cost_modifier = buy_cost_modifier;

View file

@ -31,8 +31,8 @@ struct shop_buy_data {
struct shop_data {
room_vnum vnum; /* Virtual number of this shop */
obj_vnum *producing; /* Which item to produce (virtual) */
double profit_buy; /* Factor to multiply cost with */
double profit_sell; /* Factor to multiply cost with */
float profit_buy; /* Factor to multiply cost with */
float profit_sell; /* Factor to multiply cost with */
struct shop_buy_data *type; /* Which items to trade */
char *no_such_item1; /* Message if keeper hasn't got an item */
char *no_such_item2; /* Message if player hasn't got an item */