[6896] Fixed fall damage after teleports

This commit is contained in:
arrai 2008-12-11 17:19:02 +01:00
parent 54207e753c
commit bc816b70fc
4 changed files with 9 additions and 5 deletions

View file

@ -363,10 +363,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
GetPlayer()->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); GetPlayer()->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o);
GetPlayer()->m_movementInfo = movementInfo; GetPlayer()->m_movementInfo = movementInfo;
if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z) if (GetPlayer()->m_lastFallTime >= movementInfo.fallTime || GetPlayer()->m_lastFallZ <=movementInfo.z)
{ GetPlayer()->SetFallInformation(movementInfo.fallTime, movementInfo.z);
GetPlayer()->m_lastFallTime = movementInfo.fallTime;
GetPlayer()->m_lastFallZ= movementInfo.z;
}
if(GetPlayer()->isMovingOrTurning()) if(GetPlayer()->isMovingOrTurning())
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);

View file

@ -1556,6 +1556,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
else else
// this will be used instead of the current location in SaveToDB // this will be used instead of the current location in SaveToDB
m_teleport_dest = WorldLocation(mapid, x, y, z, orientation); m_teleport_dest = WorldLocation(mapid, x, y, z, orientation);
SetFallInformation(0, z);
//BuildHeartBeatMsg(&data); //BuildHeartBeatMsg(&data);
//SendMessageToSet(&data, true); //SendMessageToSet(&data, true);
@ -1703,6 +1704,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
} }
m_teleport_dest = WorldLocation(mapid, final_x, final_y, final_z, final_o); m_teleport_dest = WorldLocation(mapid, final_x, final_y, final_z, final_o);
SetFallInformation(0, final_z);
// if the player is saved before worldportack (at logout for example) // if the player is saved before worldportack (at logout for example)
// this will be used instead of the current location in SaveToDB // this will be used instead of the current location in SaveToDB

View file

@ -1912,6 +1912,11 @@ class MANGOS_DLL_SPEC Player : public Unit
MovementInfo m_movementInfo; MovementInfo m_movementInfo;
uint32 m_lastFallTime; uint32 m_lastFallTime;
float m_lastFallZ; float m_lastFallZ;
void SetFallInformation(uint32 time, float z)
{
m_lastFallTime = time;
m_lastFallZ = z;
}
bool isMoving() const { return HasUnitMovementFlag(movementFlagsMask); } bool isMoving() const { return HasUnitMovementFlag(movementFlagsMask); }
bool isMovingOrTurning() const { return HasUnitMovementFlag(movementOrTurningFlagsMask); } bool isMovingOrTurning() const { return HasUnitMovementFlag(movementOrTurningFlagsMask); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "6895" #define REVISION_NR "6896"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__