aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-04-03 05:42:12 -0300
committerfunjoker <funjoker109@gmail.com>2020-04-27 12:25:52 +0200
commitf97c28f2f1deadd75a35631bb7ed878c6a1bec3f (patch)
tree63612ec5e6369f3bbe48ff5c78a6279db04284c4 /src/server
parent847990f030753e5545c75672968c7e99d758d6dc (diff)
Core/AHBot: fix price calc
- priceRatio is already a factor (cherry picked from commit 4a654be2fbb1857f31180f8d4edca91f7825c34a)
Diffstat (limited to 'src/server')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index ea400b30989..da14231ec3c 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -616,7 +616,9 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
if (sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYPRICE_SELLER))
buyPrice = sellPrice;
- float basePriceFloat = (buyPrice * stackCount * priceRatio) / (itemProto->GetClass() == 6 ? 200.0f : static_cast<float>(itemProto->GetBuyCount())) / 100.0f;
+ float basePriceFloat = buyPrice * stackCount / (itemProto->GetClass() == 6 ? 200.0f : static_cast<float>(itemProto->GetBuyCount()));
+ basePriceFloat *= priceRatio;
+
float range = basePriceFloat * 0.04f;
buyout = (static_cast<uint32>(frand(basePriceFloat - range, basePriceFloat + range) + 0.5f) / SILVER) * SILVER;