From 1554a7dd56e1d763a9ee8fa3276da45ae5de8911 Mon Sep 17 00:00:00 2001 From: NathanHandley Date: Sun, 27 Dec 2015 10:08:15 -0600 Subject: Simplified stack size calculation in AuctionBotSeller --- src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index 5d60b907328..6c5ba251053 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -739,19 +739,10 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf // Determines the stack size to use for the item uint32 AuctionBotSeller::GetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config) const { - uint32 randomStackPercent = config.GetRandomStackRatioPerClass(ItemClass(itemProto->Class)); - if (randomStackPercent >= 100) + if (config.GetRandomStackRatioPerClass(ItemClass(itemProto->Class)) > urand(0, 99)) return urand(1, itemProto->GetMaxStackSize()); - else if (randomStackPercent == 0) - return 1; else - { - uint32 randomStackRoll = urand(0, 99); - if (randomStackRoll < randomStackPercent) - return urand(1, itemProto->GetMaxStackSize()); - else - return 1; - } + return 1; } // Determine the multiplier for the sell price of any weapon without a buy price. -- cgit v1.2.3