mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[8612] better error-check when getting bgTypeId from Battlemasterentry
This commit is contained in:
parent
d7e01c3e16
commit
caf4732e38
4 changed files with 13 additions and 2 deletions
|
|
@ -50,6 +50,9 @@ void WorldSession::HandleBattlemasterHelloOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(unit->GetEntry());
|
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(unit->GetEntry());
|
||||||
|
|
||||||
|
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!_player->GetBGAccessByLevel(bgTypeId))
|
if (!_player->GetBGAccessByLevel(bgTypeId))
|
||||||
{
|
{
|
||||||
// temp, must be gossip message...
|
// temp, must be gossip message...
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ class BattleGroundMgr
|
||||||
BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
|
BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry);
|
||||||
if (itr != mBattleMastersMap.end())
|
if (itr != mBattleMastersMap.end())
|
||||||
return itr->second;
|
return itr->second;
|
||||||
return BATTLEGROUND_WS;
|
return BATTLEGROUND_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadBattleEventIndexes();
|
void LoadBattleEventIndexes();
|
||||||
|
|
|
||||||
|
|
@ -711,6 +711,9 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
||||||
|
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(!msg)
|
if(!msg)
|
||||||
return pPlayer->GetBGAccessByLevel(bgTypeId);
|
return pPlayer->GetBGAccessByLevel(bgTypeId);
|
||||||
|
|
||||||
|
|
@ -968,6 +971,11 @@ void Creature::OnGossipSelect(Player* player, uint32 option)
|
||||||
case GOSSIP_OPTION_BATTLEFIELD:
|
case GOSSIP_OPTION_BATTLEFIELD:
|
||||||
{
|
{
|
||||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
||||||
|
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
|
||||||
|
{
|
||||||
|
sLog.outError("a user (guid %u) requested battlegroundlist from a npc who is no battlemaster", player->GetGUIDLow());
|
||||||
|
return;
|
||||||
|
}
|
||||||
player->GetSession()->SendBattlegGroundList( GetGUID(), bgTypeId );
|
player->GetSession()->SendBattlegGroundList( GetGUID(), bgTypeId );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8611"
|
#define REVISION_NR "8612"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue