[7371] Correctly select closest graveyard in Player::RepoopAtGraveyard(). Patch provided by balrok Thx.

Signed-off-by: Triply <triply@getmangos.com>
This commit is contained in:
Triply 2009-03-02 10:38:08 +01:00
parent a50606d225
commit f454ddf6d0
2 changed files with 5 additions and 5 deletions

View file

@ -4261,11 +4261,11 @@ void Player::RepopAtGraveyard()
WorldSafeLocsEntry const *ClosestGrave = NULL;
// Special handle for battleground maps
BattleGround *bg = sBattleGroundMgr.GetBattleGround(GetBattleGroundId(), m_bgTypeID);
if( GetBattleGroundTypeId() == BATTLEGROUND_AB || GetBattleGroundTypeId() == BATTLEGROUND_EY )
if( BattleGround *bg = GetBattleGround() )
ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY))
ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
else
if(!ClosestGrave)
ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() );
// stop countdown until repop