Added some missing SetFallInformation calls

Port From (https://github.com/TrinityCore/TrinityCore/commit/cfefd27cb8171b7fe28781eb8f1d903272830f22)
This commit is contained in:
hondacrx
2019-08-17 12:54:12 -04:00
parent 0a29281557
commit a89ace13c8
6 changed files with 31 additions and 6 deletions
+2 -2
View File
@@ -1790,7 +1790,7 @@ namespace Game.Entities
// this will be used instead of the current location in SaveToDB
teleportDest = new WorldLocation(mapid, x, y, z, orientation);
m_teleport_options = options;
SetFallInformation(0, z);
SetFallInformation(0, GetPositionZ());
// code for finish transfer called in WorldSession.HandleMovementOpcodes()
// at client packet CMSG_MOVE_TELEPORT_ACK
@@ -1902,7 +1902,7 @@ namespace Game.Entities
teleportDest = new WorldLocation(mapid, x, y, z, orientation);
m_teleport_options = options;
SetFallInformation(0, z);
SetFallInformation(0, GetPositionZ());
// if the player is saved before worldportack (at logout for example)
// this will be used instead of the current location in SaveToDB
+10 -3
View File
@@ -305,8 +305,12 @@ namespace Game.Entities
passenger.m_movementInfo.transport.Reset();
Log.outDebug(LogFilter.Transport, "Object {0} removed from transport {1}.", passenger.GetName(), GetName());
if (passenger.IsTypeId(TypeId.Player))
Global.ScriptMgr.OnRemovePassenger(this, passenger.ToPlayer());
Player plr = passenger.ToPlayer();
if (plr != null)
{
Global.ScriptMgr.OnRemovePassenger(this, plr);
plr.SetFallInformation(0, plr.GetPositionZ());
}
}
}
@@ -727,8 +731,11 @@ namespace Game.Entities
break;
}
case TypeId.Player:
if (passenger.IsInWorld)
if (passenger.IsInWorld && !passenger.ToPlayer().IsBeingTeleported())
{
GetMap().PlayerRelocation(passenger.ToPlayer(), x, y, z, o);
passenger.ToPlayer().SetFallInformation(0, passenger.GetPositionZ());
}
break;
case TypeId.GameObject:
GetMap().GameObjectRelocation(passenger.ToGameObject(), x, y, z, o, false);
+7 -1
View File
@@ -92,7 +92,11 @@ namespace Game
//handle special cases
if (!movementInfo.transport.guid.IsEmpty())
{
if (movementInfo.transport.pos.GetPositionX() > 50 || movementInfo.transport.pos.GetPositionY() > 50 || movementInfo.transport.pos.GetPositionZ() > 50)
// We were teleported, skip packets that were broadcast before teleport
if (movementInfo.Pos.GetExactDist2d(mover) > MapConst.SizeofGrids)
return;
if (Math.Abs(movementInfo.transport.pos.GetPositionX()) > 75f || Math.Abs(movementInfo.transport.pos.GetPositionY()) > 75f || Math.Abs(movementInfo.transport.pos.GetPositionZ()) > 75f)
return;
if (!GridDefines.IsValidMapCoord(movementInfo.Pos.posX + movementInfo.transport.pos.posX, movementInfo.Pos.posY + movementInfo.transport.pos.posY,
@@ -267,6 +271,7 @@ namespace Game
z += GetPlayer().m_unitData.HoverHeight;
GetPlayer().Relocate(loc.GetPositionX(), loc.GetPositionY(), z, loc.GetOrientation());
GetPlayer().SetFallInformation(0, GetPlayer().GetPositionZ());
GetPlayer().ResetMap();
GetPlayer().SetMap(newMap);
@@ -446,6 +451,7 @@ namespace Game
WorldLocation dest = plMover.GetTeleportDest();
plMover.UpdatePosition(dest, true);
plMover.SetFallInformation(0, GetPlayer().GetPositionZ());
uint newzone, newarea;
plMover.GetZoneAndAreaId(out newzone, out newarea);
@@ -442,6 +442,7 @@ namespace Game.Movement
// this prevent cheating with landing point at lags
// when client side flight end early in comparison server side
owner.StopMoving();
owner.SetFallInformation(0, owner.GetPositionZ());
}
owner.RemovePlayerFlag(PlayerFlags.TaxiBenchmark);
+3
View File
@@ -525,7 +525,10 @@ namespace Game.Movement
// don't run spline movement for players
if (_owner.IsTypeId(TypeId.Player))
{
_owner.ToPlayer().SetFallInformation(0, _owner.GetPositionZ());
return;
}
MoveSplineInit init = new MoveSplineInit(_owner);
init.MoveTo(_owner.GetPositionX(), _owner.GetPositionY(), tz, false);
+8
View File
@@ -4095,6 +4095,10 @@ namespace Game.Spells
if (effectHandleMode == SpellEffectHandleMode.LaunchTarget)
{
// charge changes fall time
if (m_caster.GetTypeId() == TypeId.Player)
m_caster.ToPlayer().SetFallInformation(0, m_caster.GetPositionZ());
float speed = MathFunctions.fuzzyGt(m_spellInfo.Speed, 0.0f) ? m_spellInfo.Speed : MotionMaster.SPEED_CHARGE;
SpellEffectExtraData spellEffectExtraData = null;
if (effectInfo.MiscValueB != 0)
@@ -4204,6 +4208,10 @@ namespace Game.Spells
float speedz = damage / 10.0f;
// Disengage
unitTarget.JumpTo(speedxy, speedz, m_spellInfo.IconFileDataId != 132572);
// changes fall time
if (m_caster.GetTypeId() == TypeId.Player)
m_caster.ToPlayer().SetFallInformation(0, m_caster.GetPositionZ());
}
[SpellEffectHandler(SpellEffectName.ClearQuest)]