mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 14:10:18 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user