Restores shop item values after previous precision change.
This commit is contained in:
@@ -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)
|
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)
|
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
|
/* 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. */
|
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)
|
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 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)) / (double)70);
|
float buy_cost_modifier = SHOP_BUYPROFIT(shop_nr) * (1 + (GET_CHA(keeper) - GET_CHA(seller)) / 70.0);
|
||||||
|
|
||||||
if (sell_cost_modifier > buy_cost_modifier)
|
if (sell_cost_modifier > buy_cost_modifier)
|
||||||
sell_cost_modifier = buy_cost_modifier;
|
sell_cost_modifier = buy_cost_modifier;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ struct shop_buy_data {
|
|||||||
struct shop_data {
|
struct shop_data {
|
||||||
room_vnum vnum; /* Virtual number of this shop */
|
room_vnum vnum; /* Virtual number of this shop */
|
||||||
obj_vnum *producing; /* Which item to produce (virtual) */
|
obj_vnum *producing; /* Which item to produce (virtual) */
|
||||||
double profit_buy; /* Factor to multiply cost with */
|
float profit_buy; /* Factor to multiply cost with */
|
||||||
double profit_sell; /* Factor to multiply cost with */
|
float profit_sell; /* Factor to multiply cost with */
|
||||||
struct shop_buy_data *type; /* Which items to trade */
|
struct shop_buy_data *type; /* Which items to trade */
|
||||||
char *no_such_item1; /* Message if keeper hasn't got an item */
|
char *no_such_item1; /* Message if keeper hasn't got an item */
|
||||||
char *no_such_item2; /* Message if player hasn't got an item */
|
char *no_such_item2; /* Message if player hasn't got an item */
|
||||||
|
|||||||
Reference in New Issue
Block a user