[7372] Cleanup BattleGround::GetClosestGraveYard related code.

This commit is contained in:
VladimirMangos 2009-03-02 15:35:41 +03:00
parent f454ddf6d0
commit 9983286280
8 changed files with 41 additions and 29 deletions

View file

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