diff options
author | megamage <none@none> | 2009-02-10 10:04:40 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-10 10:04:40 -0600 |
commit | 5881c6b91bb5f6a79bc9fe9d3dfdb0f2b16c1362 (patch) | |
tree | 245420be6b0cf125b415f74422f10f668b0bccca /src/game/Player.cpp | |
parent | 31f49932647433b484bf91a9cc5a56fd44473459 (diff) |
[7261] Better check DB corrdinates for bg entry at player loading. By Vladimir.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r-- | src/game/Player.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7d2767275c6..56877656876 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14576,7 +14576,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) SetBattleGroundEntryPoint(fields[36].GetUInt32(),fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat()); // check entry point and fix to homebind if need - if(!MapManager::IsValidMapCoord(m_bgEntryPoint)) + MapEntry const* mapEntry = sMapStore.LookupEntry(m_bgEntryPoint.mapid); + if(!mapEntry || mapEntry->Instanceable() || !MapManager::IsValidMapCoord(m_bgEntryPoint)) SetBattleGroundEntryPoint(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ,0.0f); BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(bgid); @@ -14607,8 +14608,10 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // return to BG master SetMapId(fields[36].GetUInt32()); Relocate(fields[37].GetFloat(),fields[38].GetFloat(),fields[39].GetFloat(),fields[40].GetFloat()); + // check entry point and fix to homebind if need - if(!IsPositionValid()) + mapEntry = sMapStore.LookupEntry(GetMapId()); + if(!mapEntry || mapEntry->IsBattleGroundOrArena() || !IsPositionValid()) RelocateToHomebind(); } } |