Code:
if(dwPrice > item->GetGold())
dwPrice=item->GetGold();
i think it should be "<" not ">"
so you should put
Code:
if(dwPrice < item->GetGold())
dwPrice=item->GetGold();
cuz if the buy price is lower than sell price you should use the sell price.. anyway, an easier way to fix that.. and without using a source code would be runing this code in mysql command line
Code:
UPDATE item_proto
SET shop_buy_price = gold
WHERE shop_buy_price<gold
(this one will set buy price to same value as sell price if the buy price is lower than sell price)
or
Code:
UPDATE item_proto
SET gold = shop_buy_price
WHERE shop_buy_price<gold
(this one will set sell price to same value as buy price if the buy price is lower than sell price)