diff options
author | Chaz Brown <iamparadox@netscape.net> | 2009-09-24 17:34:29 -0400 |
---|---|---|
committer | Chaz Brown <iamparadox@netscape.net> | 2009-09-24 17:34:29 -0400 |
commit | 135888af848a1ac1c39e12f7bd69ca5b1fdc1fbb (patch) | |
tree | 2187a224ca2f0e42b3d1099b72e2acd52c52fe16 | |
parent | a1141b4a8b43c8daf090e018d822447c93c1c46a (diff) |
* Hopefully, MTMaps will only be enabled in release, and not in debug modes (This was causing debug builds to not run under windows)
* Fixed a bug in AHBot where auctions being removed were sometimes seen as the wrong faction, leading to problems with replacing them with new auctions.
* Added loopbreaker back in, just in case...
--HG--
branch : trunk
-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; } |