Addressed several compiler warnings.

This commit is contained in:
mcclure
2017-10-09 13:03:48 -04:00
parent 08374524d0
commit fc4c64c782
61 changed files with 163 additions and 395 deletions

View File

@@ -9,8 +9,6 @@
* By Jeff Fink. *
**************************************************************************/
#define __SHOP_C__
#include "conf.h"
#include "sysdep.h"
#include "structs.h"
@@ -458,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)) / (float)70));
* (1 + (GET_CHA(keeper) - GET_CHA(buyer)) / (double)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)) / (float)70);
float buy_cost_modifier = SHOP_BUYPROFIT(shop_nr) * (1 + (GET_CHA(keeper) - GET_CHA(seller)) / (float)70);
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);
if (sell_cost_modifier > buy_cost_modifier)
sell_cost_modifier = buy_cost_modifier;