[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.
This commit is contained in:
VladimirMangos 2009-02-08 09:28:41 +03:00
parent e355084376
commit 5a4358dda9
29 changed files with 319 additions and 262 deletions

View file

@ -373,15 +373,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;
@ -439,14 +439,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);
@ -539,7 +531,6 @@ class ObjectMgr
void LoadQuestAreaTriggers();
void LoadAreaTriggerScripts();
void LoadTavernAreaTriggers();
void LoadBattleMastersEntry();
void LoadGameObjectForQuests();
void LoadItemTexts();
@ -798,7 +789,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;
@ -817,7 +807,6 @@ class ObjectMgr
AuctionHouseObject mNeutralAuctions;
QuestAreaTriggerMap mQuestAreaTriggerMap;
BattleMastersMap mBattleMastersMap;
TavernAreaTriggerSet mTavernAreaTriggerSet;
GameObjectForQuestSet mGameObjectForQuestSet;
GossipTextMap mGossipText;