aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-02 17:09:59 -0600
committermegamage <none@none>2009-03-02 17:09:59 -0600
commit27cf8127b463a0592e8dc095e8d76189e27935b5 (patch)
treeaa78069129bf9e7c81a9f25b2c9cebc97d26f8d4 /src/game/Player.cpp
parent0b32a2c7510ada90e7e1f8a91229fc73e9aa7753 (diff)
[7371] Correctly select closest graveyard in Player::RepoopAtGraveyard(). Patch provided by balrok Thx.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 6ce7e9c356a..5290e2521b0 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -4366,11 +4366,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 || GetBattleGroundTypeId() == BATTLEGROUND_AV)
+ if( BattleGround *bg = GetBattleGround() )
+ ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
- if(bg && (bg->GetTypeID() == BATTLEGROUND_AB || bg->GetTypeID() == BATTLEGROUND_EY || bg->GetTypeID() == BATTLEGROUND_AV))
- ClosestGrave = bg->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetTeam());
- else
+ if(!ClosestGrave)
ClosestGrave = objmgr.GetClosestGraveYard( GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam() );
// stop countdown until repop