diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 004f5e050..868f5b9d9 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -50,6 +50,9 @@ void WorldSession::HandleBattlemasterHelloOpcode( WorldPacket & recv_data ) BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(unit->GetEntry()); + if (bgTypeId == BATTLEGROUND_TYPE_NONE) + return; + if (!_player->GetBGAccessByLevel(bgTypeId)) { // temp, must be gossip message... diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h index 5fb3668c0..4d72d9656 100644 --- a/src/game/BattleGroundMgr.h +++ b/src/game/BattleGroundMgr.h @@ -235,7 +235,7 @@ class BattleGroundMgr BattleMastersMap::const_iterator itr = mBattleMastersMap.find(entry); if (itr != mBattleMastersMap.end()) return itr->second; - return BATTLEGROUND_WS; + return BATTLEGROUND_TYPE_NONE; } void LoadBattleEventIndexes(); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 89abfc303..38c5bc5a9 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -711,6 +711,9 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const return false; BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry()); + if (bgTypeId == BATTLEGROUND_TYPE_NONE) + return false; + if(!msg) return pPlayer->GetBGAccessByLevel(bgTypeId); @@ -968,6 +971,11 @@ void Creature::OnGossipSelect(Player* player, uint32 option) case GOSSIP_OPTION_BATTLEFIELD: { 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 ); break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1f738eb52..702f6cf17 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8611" + #define REVISION_NR "8612" #endif // __REVISION_NR_H__