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
+1 -1
View File
@@ -547,7 +547,7 @@ struct AreaTableEntry
char* area_name; // 11
uint32 team; // 12
uint32 LiquidTypeOverride[4]; // 13-16 liquid override by type
//float unk13; // 17,
float MaxDepth; // 17,
//float unk13; // 18,
//uint32 unk19; // 19, All zeros (4.2.2)
//uint32 unk20; // 20 4.0.0
+1 -1
View File
@@ -26,7 +26,7 @@ const char Achievementfmt[]="niixsxiixixxii";
//const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp";
//const std::string CustomAchievementIndex = "ID";
const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii";
const char AreaTableEntryfmt[]="iiinixxxxxisiiiiixxxxxxxxx";
const char AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx";
const char AreaGroupEntryfmt[]="niiiiiii";
const char AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx";
const char AreaTriggerEntryfmt[]="nifffxxxfffff";
+2 -2
View File
@@ -5524,7 +5524,7 @@ void Player::RepopAtGraveyard()
AreaTableEntry const* zone = GetAreaEntryByAreaID(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f)
if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < zone->MaxDepth)
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();
@@ -5566,7 +5566,7 @@ void Player::RepopAtGraveyard()
GetSession()->SendPacket(&data);
}
}
else if (GetPositionZ() < -500.0f)
else if (GetPositionZ() < zone->MaxDepth)
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
}
+4 -2
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)))
{