aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
diff options
context:
space:
mode:
authorNathanHandley <necreia@gmail.com>2015-12-25 19:47:38 -0600
committerNathanHandley <necreia@gmail.com>2015-12-25 19:47:38 -0600
commitec3a98caeb879ec295959b49f733de4f8324b354 (patch)
treedad4d62c2f366ee3d532a0edf32643b0fcd90754 /src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
parent33a75afb60f8e9ad44c7a87f7f52dae27dab62b6 (diff)
Updates in respnose to feedback from DDuarte. Including:
- Changed SetStackSizeForItem to GetStackSizeForItem in AuctionHouseBotSeller - Added Initializer to SellerItemClassInfo.RandomStackRatio in AuctionHouseBotSeller - Updated verbiage around AuctionHouseBot.Class.RandomStackRatio.* to be clearer
Diffstat (limited to 'src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp')
-rw-r--r--src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
index 6375b9726e6..5d60b907328 100644
--- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
+++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
@@ -737,20 +737,20 @@ void AuctionBotSeller::SetPricesOfItem(ItemTemplate const* itemProto, SellerConf
}
// Determines the stack size to use for the item
-void AuctionBotSeller::SetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config, uint32& stackcnt)
+uint32 AuctionBotSeller::GetStackSizeForItem(ItemTemplate const* itemProto, SellerConfiguration& config) const
{
uint32 randomStackPercent = config.GetRandomStackRatioPerClass(ItemClass(itemProto->Class));
if (randomStackPercent >= 100)
- stackcnt = urand(1, itemProto->GetMaxStackSize());
+ return urand(1, itemProto->GetMaxStackSize());
else if (randomStackPercent == 0)
- stackcnt = 1;
+ return 1;
else
{
uint32 randomStackRoll = urand(0, 99);
if (randomStackRoll < randomStackPercent)
- stackcnt = urand(1, itemProto->GetMaxStackSize());
+ return urand(1, itemProto->GetMaxStackSize());
else
- stackcnt = 1;
+ return 1;
}
}
@@ -987,8 +987,7 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config)
continue;
}
- uint32 stackCount = 1;
- SetStackSizeForItem(prototype, config, stackCount);
+ uint32 stackCount = GetStackSizeForItem(prototype, config);
Item* item = Item::CreateItem(itemId, stackCount);
if (!item)