Core/Maps: Improvements to terrain swap handling

Port From (https://github.com/TrinityCore/TrinityCore/commit/eba31dea27b7fdc4a49c024898ef3a01bcbc7295)
This commit is contained in:
hondacrx
2020-05-25 20:32:24 -04:00
parent 888d281aa7
commit c695b3ee5f
9 changed files with 119 additions and 88 deletions
+2 -2
View File
@@ -4692,7 +4692,7 @@ namespace Game.Entities
AreaTableRecord zone = CliDB.AreaTableStorage.LookupByKey(GetAreaId());
// Such zones are considered unreachable as a ghost and the player must be automatically revived
if ((!IsAlive() && zone != null && zone.Flags[0].HasAnyFlag(AreaFlags.NeedFly)) || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPositionX(), GetPositionY()))
if ((!IsAlive() && zone != null && zone.Flags[0].HasAnyFlag(AreaFlags.NeedFly)) || GetTransport() != null || GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
{
ResurrectPlayer(0.5f);
SpawnCorpseBones();
@@ -4729,7 +4729,7 @@ namespace Game.Entities
SendPacket(packet);
}
}
else if (GetPositionZ() < GetMap().GetMinHeight(GetPositionX(), GetPositionY()))
else if (GetPositionZ() < GetMap().GetMinHeight(GetPhaseShift(), GetPositionX(), GetPositionY()))
TeleportTo(homebind);
RemovePlayerFlag(PlayerFlags.IsOutOfBounds);