Core/Maps: Use DBC value to determine the maximum depth that a player can reach in an area before being teleported back up.

This commit is contained in:
Subv
2012-09-26 12:10:23 -05:00
parent 0d8a8e9486
commit 1bb39edd02
4 changed files with 8 additions and 6 deletions

View File

@@ -397,8 +397,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
if (plrMover) // nothing is charmed, or player charmed
{
plrMover->UpdateFallInformationIfNeed(movementInfo, opcode);
if (movementInfo.pos.GetPositionZ() < -500.0f)
AreaTableEntry const* zone = GetAreaEntryByAreaID(plrMover->GetAreaId());
float depth = zone ? zone->MaxDepth : -500.0f;
if (movementInfo.pos.GetPositionZ() < depth)
{
if (!(plrMover->GetBattleground() && plrMover->GetBattleground()->HandlePlayerUnderMap(_player)))
{