[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; WorldSafeLocsEntry const *ClosestGrave = NULL;
// Special handle for battleground maps // 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)) if(!ClosestGrave)
ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
else
ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() ); ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() );
// stop countdown until repop // stop countdown until repop

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7370" #define REVISION_NR "7371"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__