aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AuctionHouseBot
diff options
context:
space:
mode:
authorNathanHandley <necreia@gmail.com>2015-12-27 10:08:15 -0600
committerNathanHandley <necreia@gmail.com>2015-12-27 10:08:15 -0600
commit1554a7dd56e1d763a9ee8fa3276da45ae5de8911 (patch)
tree5a4a41f9da4670fcc7a96d32a92e49a49e48b7a4 /src/server/game/AuctionHouseBot
parentec3a98caeb879ec295959b49f733de4f8324b354 (diff)
Simplified stack size calculation in AuctionBotSeller
Diffstat (limited to 'src/server/game/AuctionHouseBot')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp13
1 files changed, 2 insertions, 11 deletions
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.