[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:
@@ -39,7 +39,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "WaypointMovementGenerator.h"
|
||||
#include "InstanceData.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "Util.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -760,7 +760,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||
if(!isBattleMaster())
|
||||
return false;
|
||||
|
||||
uint32 bgTypeId = objmgr.GetBattleMasterBG(GetEntry());
|
||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
||||
if(!msg)
|
||||
return pPlayer->GetBGAccessByLevel(bgTypeId);
|
||||
|
||||
@@ -1027,7 +1027,7 @@ void Creature::OnGossipSelect(Player* player, uint32 option)
|
||||
break;
|
||||
case GOSSIP_OPTION_BATTLEFIELD:
|
||||
{
|
||||
uint32 bgTypeId = objmgr.GetBattleMasterBG(GetEntry());
|
||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
||||
player->GetSession()->SendBattlegGroundList( GetGUID(), bgTypeId );
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user