[11861] Prevent removing template bgs from visible bg list

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
stfx 2011-12-12 15:29:30 +01:00 committed by Schmoozerd
parent 53206fbe26
commit e0d6952ad1
3 changed files with 8 additions and 3 deletions

View file

@ -212,7 +212,7 @@ BattleGround::BattleGround()
m_Status = STATUS_NONE;
m_ClientInstanceID = 0;
m_EndTime = 0;
m_BracketId = BG_BRACKET_ID_FIRST;
m_BracketId = BG_BRACKET_ID_TEMPLATE;
m_InvitedAlliance = 0;
m_InvitedHorde = 0;
m_ArenaType = ARENA_TYPE_NONE;
@ -286,7 +286,11 @@ BattleGround::~BattleGround()
DelObject(i);
sBattleGroundMgr.RemoveBattleGround(GetInstanceID(), GetTypeID());
sBattleGroundMgr.DeleteClientVisibleInstanceId(GetTypeID(), GetBracketId(), GetClientInstanceID());
// skip template bgs as they were never added to visible bg list
BattleGroundBracketId bracketId = GetBracketId();
if (bracketId != BG_BRACKET_ID_TEMPLATE)
sBattleGroundMgr.DeleteClientVisibleInstanceId(GetTypeID(), bracketId, GetClientInstanceID());
// unload map
// map can be null at bg destruction

View file

@ -34,6 +34,7 @@
enum BattleGroundBracketId // bracketId for level ranges
{
BG_BRACKET_ID_TEMPLATE = -1, // used to mark bg as template
BG_BRACKET_ID_FIRST = 0,
BG_BRACKET_ID_LAST = 15
};

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11860"
#define REVISION_NR "11861"
#endif // __REVISION_NR_H__