From 08f5eb89476e343dd713c1c1ab9a225e877a5215 Mon Sep 17 00:00:00 2001 From: wyld-sw Date: Fri, 3 Nov 2017 07:44:22 -0400 Subject: [PATCH] Restores shop item values after previous precision change. --- src/shop.c | 6 +++--- src/shop.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shop.c b/src/shop.c index 0a23384..2aed6b1 100644 --- a/src/shop.c +++ b/src/shop.c @@ -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; diff --git a/src/shop.h b/src/shop.h index 47b6d61..16c53d3 100644 --- a/src/shop.h +++ b/src/shop.h @@ -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 */