diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
| commit | 85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch) | |
| tree | df3d2084ee2e35008903c03178039b9c986e2d08 /src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | |
| parent | 052fc24315ace866ea1cf610e85df119b68100c9 (diff) | |
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp')
| -rw-r--r-- | src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index 6fd11aa6406..7c1ba67d547 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -15,12 +15,16 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "Log.h" +#include "AuctionHouseBotSeller.h" +#include "AuctionHouseMgr.h" #include "Containers.h" +#include "DatabaseEnv.h" #include "DBCStores.h" +#include "Item.h" +#include "Log.h" #include "ObjectMgr.h" -#include "AuctionHouseMgr.h" -#include "AuctionHouseBotSeller.h" +#include "Random.h" +#include <sstream> AuctionBotSeller::AuctionBotSeller() { @@ -62,13 +66,9 @@ bool AuctionBotSeller::Initialize() TC_LOG_DEBUG("ahbot", "Loading npc vendor items for filter.."); CreatureTemplateContainer const* creatures = sObjectMgr->GetCreatureTemplates(); for (CreatureTemplateContainer::const_iterator it = creatures->begin(); it != creatures->end(); ++it) - { if (VendorItemData const* data = sObjectMgr->GetNpcVendorItemList(it->first)) - { - for (VendorItemList::const_iterator it2 = data->m_items.begin(); it2 != data->m_items.end(); ++it2) - npcItems.insert((*it2)->item); - } - } + for (VendorItem const& it2 : data->m_items) + npcItems.insert(it2.item); TC_LOG_DEBUG("ahbot", "Npc vendor filter has %u items", (uint32)npcItems.size()); @@ -108,7 +108,6 @@ bool AuctionBotSeller::Initialize() for (uint32 itemId = 0; itemId < sItemStore.GetNumRows(); ++itemId) { ItemTemplate const* prototype = sObjectMgr->GetItemTemplate(itemId); - if (!prototype) continue; @@ -890,7 +889,7 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) // Update the just created item so that if it needs random properties it has them. // Ex: Notched Shortsword of Stamina will only generate as a Notched Shortsword without this. - if (int32 randomPropertyId = Item::GenerateItemRandomPropertyId(itemId)) + if (int32 randomPropertyId = GenerateItemRandomPropertyId(itemId)) item->SetItemRandomProperties(randomPropertyId); uint32 buyoutPrice; @@ -927,7 +926,7 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) auctionEntry->bid = 0; auctionEntry->deposit = sAuctionMgr->GetAuctionDeposit(ahEntry, etime, item, stackCount); auctionEntry->auctionHouseEntry = ahEntry; - auctionEntry->expire_time = time(NULL) + urand(config.GetMinTime(), config.GetMaxTime()) * HOUR; + auctionEntry->expire_time = time(nullptr) + urand(config.GetMinTime(), config.GetMaxTime()) * HOUR; item->SaveToDB(trans); sAuctionMgr->AddAItem(item); |
