diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/framework/Platform/Define.h | 13 | ||||
-rw-r--r-- | src/game/AuctionHouseBot.cpp | 45 |
2 files changed, 21 insertions, 37 deletions
diff --git a/src/framework/Platform/Define.h b/src/framework/Platform/Define.h index dc5c248bf8c..d29a53dbf31 100644 --- a/src/framework/Platform/Define.h +++ b/src/framework/Platform/Define.h @@ -137,11 +137,6 @@ typedef uint32 DWORD; typedef uint64 OBJECT_HANDLE; -#define MULTI_THREAD_MAP -#ifdef MULTI_THREAD_MAP -#define MAP_BASED_RAND_GEN -#endif - #define MaNGOS Trinity #define MANGOS_DLL_DECL TRINITY_DLL_DECL #define MANGOS_DLL_SPEC TRINITY_DLL_SPEC @@ -156,6 +151,14 @@ typedef uint64 OBJECT_HANDLE; # endif #endif +#if !defined(DEBUG) && !defined(MANGOS_DEBUG) && !defined(TRINITY_DEBUG) +#define MULTI_THREAD_MAP +#endif + +#ifdef MULTI_THREAD_MAP +#define MAP_BASED_RAND_GEN +#endif + #ifndef CLIENT_VER #define CLIENT_VER 313 #endif diff --git a/src/game/AuctionHouseBot.cpp b/src/game/AuctionHouseBot.cpp index b4c00e4b42c..663e2f24089 100644 --- a/src/game/AuctionHouseBot.cpp +++ b/src/game/AuctionHouseBot.cpp @@ -221,8 +221,10 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config) if (debug_Out) sLog.outString("AHSeller: %u count", cnt); uint32 itemID = 0; uint32 itemColor = 99; - while (itemID == 0) + uint32 loopbreaker = 0; + while (itemID == 0 && loopbreaker <= 50) { + ++loopbreaker; uint32 choice = urand(0, 13); itemColor = choice; switch (choice) @@ -489,27 +491,6 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con return; } - /* - uint32 AuctioneerGUID = 0; - - switch (config->GetAHID()) - { - case 2: - AuctioneerGUID = 79707; //Human in stormwind. - break; - case 6: - AuctioneerGUID = 4656; //orc in Orgrimmar - break; - case 7: - AuctioneerGUID = 23442; //goblin in GZ - break; - default: - if (debug_Out) sLog.outError("AHSeller: GetAHID() - Default switch reached"); - AuctioneerGUID = 23442; //default to neutral 7 - break; - } - */ - QueryResult* result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE itemowner<>%u AND buyguid<>%u", AHBplayerGUID, AHBplayerGUID); if (!result) @@ -1422,25 +1403,25 @@ void AuctionHouseBot::IncrementItemCounts(AuctionEntry* ah) AHBConfig *config; - FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(ah->GetHouseId()); + FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(ah->GetHouseFaction()); if (!u_entry) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. No Entry", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Neutral", ah->GetHouseFaction()); config = &NeutralConfig; } else if (u_entry->ourMask & FACTION_MASK_ALLIANCE) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Alliance", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Alliance", ah->GetHouseFaction()); config = &AllianceConfig; } else if (u_entry->ourMask & FACTION_MASK_HORDE) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Horde", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Horde", ah->GetHouseFaction()); config = &HordeConfig; } else { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Neutral", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Neutral", ah->GetHouseFaction()); config = &NeutralConfig; } @@ -1454,25 +1435,25 @@ void AuctionHouseBot::DecrementItemCounts(AuctionEntry* ah, uint32 item_template AHBConfig *config; - FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(ah->GetHouseId()); + FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(ah->GetHouseFaction()); if (!u_entry) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. No Entry", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Neutral", ah->GetHouseFaction()); config = &NeutralConfig; } else if (u_entry->ourMask & FACTION_MASK_ALLIANCE) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Alliance", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Alliance", ah->GetHouseFaction()); config = &AllianceConfig; } else if (u_entry->ourMask & FACTION_MASK_HORDE) { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Horde", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Horde", ah->GetHouseFaction()); config = &HordeConfig; } else { - if (debug_Out) sLog.outError("AHBot: %u returned as House ID. Neutral", ah->GetHouseId()); + if (debug_Out) sLog.outError("AHBot: %u returned as House Faction. Neutral", ah->GetHouseFaction()); config = &NeutralConfig; } |