[7250] Use bg type ids enum insted raw values and catch some bugs in result for fixing.

* Replace max bg type checks by DBC valid index check
    * Use in functions and fields BattlegroundTypeId type instead uint32
    * Fixed wrong use bg queue ids instead bg type ids in queue update/remove function calls.
      Many bg have same raw values for type id and queue id but some can be affected by this bug:
      BATTLEGROUND_EY, BATTLEGROUND_SA, and all areans (with small arena/team size exceptions)
    * Move Battlemaster to bg type ids map fron ObjectMgr to BatteleGroundMgr.
    * Remobe redundent for header itself includes for BG headers.
    * Use Auction location enum instead raw valus.
Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-09 22:08:06 -06:00
parent 99c8226216
commit d696381f32
33 changed files with 337 additions and 279 deletions
+3 -14
View File
@@ -399,15 +399,15 @@ class ObjectMgr
mAitems.erase(i);
return true;
}
AuctionHouseObject * GetAuctionsMap( uint32 location );
AuctionHouseObject * GetAuctionsMap( AuctionLocation location );
//auction messages
void SendAuctionWonMail( AuctionEntry * auction );
void SendAuctionSalePendingMail( AuctionEntry * auction );
void SendAuctionSuccessfulMail( AuctionEntry * auction );
void SendAuctionExpiredMail( AuctionEntry * auction );
static uint32 GetAuctionCut( uint32 location, uint32 highBid );
static uint32 GetAuctionDeposit(uint32 location, uint32 time, Item *pItem);
static uint32 GetAuctionCut( AuctionLocation location, uint32 highBid );
static uint32 GetAuctionDeposit(AuctionLocation location, uint32 time, Item *pItem);
static uint32 GetAuctionOutBid(uint32 currentBid);
PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint32 level) const;
@@ -465,14 +465,6 @@ class ObjectMgr
return false;
}
uint32 GetBattleMasterBG(uint32 entry) const
{
BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
if(itr != mBattleMastersMap.end())
return itr->second;
return 2; //BATTLEGROUND_WS - i will not add include only for constant usage!
}
void AddGossipText(GossipText *pGText);
GossipText *GetGossipText(uint32 Text_ID);
@@ -569,7 +561,6 @@ class ObjectMgr
void LoadQuestAreaTriggers();
void LoadAreaTriggerScripts();
void LoadTavernAreaTriggers();
void LoadBattleMastersEntry();
void LoadGameObjectForQuests();
void LoadItemTexts();
@@ -836,7 +827,6 @@ class ObjectMgr
typedef UNORDERED_MAP<uint32, GossipText*> GossipTextMap;
typedef UNORDERED_MAP<uint32, uint32> QuestAreaTriggerMap;
typedef UNORDERED_MAP<uint32, uint32> BattleMastersMap;
typedef UNORDERED_MAP<uint32, std::string> ItemTextMap;
typedef std::set<uint32> TavernAreaTriggerSet;
typedef std::set<uint32> GameObjectForQuestSet;
@@ -855,7 +845,6 @@ class ObjectMgr
AuctionHouseObject mNeutralAuctions;
QuestAreaTriggerMap mQuestAreaTriggerMap;
BattleMastersMap mBattleMastersMap;
TavernAreaTriggerSet mTavernAreaTriggerSet;
GameObjectForQuestSet mGameObjectForQuestSet;
GossipTextMap mGossipText;