mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10620] Fixed MSG_MOVE_HEARTBEAT structure.
Thx Wojta for pointing. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
811a86baf5
commit
3c6d5e985f
4 changed files with 14 additions and 31 deletions
|
|
@ -432,22 +432,12 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTim
|
|||
SendMonsterMove(x, y, z, SPLINETYPE_NORMAL, flags, transitTime, player);
|
||||
}
|
||||
|
||||
void Unit::BuildHeartBeatMsg(WorldPacket *data) const
|
||||
void Unit::SendHeartBeat(bool toSelf)
|
||||
{
|
||||
MovementFlags move_flags = GetTypeId()==TYPEID_PLAYER
|
||||
? ((Player const*)this)->m_movementInfo.GetMovementFlags()
|
||||
: MOVEFLAG_NONE;
|
||||
|
||||
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
|
||||
*data << GetPackGUID();
|
||||
*data << uint32(move_flags); // movement flags
|
||||
*data << uint16(0); // 2.3.0
|
||||
*data << uint32(getMSTime()); // time
|
||||
*data << float(GetPositionX());
|
||||
*data << float(GetPositionY());
|
||||
*data << float(GetPositionZ());
|
||||
*data << float(GetOrientation());
|
||||
*data << uint32(0);
|
||||
WorldPacket data(MSG_MOVE_HEARTBEAT, 64);
|
||||
data << GetPackGUID();
|
||||
data << m_movementInfo;
|
||||
SendMessageToSet(&data, toSelf);
|
||||
}
|
||||
|
||||
void Unit::resetAttackTimer(WeaponAttackType type)
|
||||
|
|
@ -3694,9 +3684,7 @@ void Unit::SetFacingTo(float ori, bool bToSelf /*= false*/)
|
|||
SetOrientation(ori);
|
||||
|
||||
// and client
|
||||
WorldPacket data;
|
||||
BuildHeartBeatMsg(&data);
|
||||
SendMessageToSet(&data, bToSelf);
|
||||
SendHeartBeat(bToSelf);
|
||||
}
|
||||
|
||||
// Consider move this to Creature:: since only creature appear to be able to use this
|
||||
|
|
@ -9822,9 +9810,7 @@ void Unit::StopMoving()
|
|||
SendMonsterMove(GetPositionX(), GetPositionY(), GetPositionZ(), SPLINETYPE_STOP, GetTypeId() == TYPEID_PLAYER ? SPLINEFLAG_WALKMODE : SPLINEFLAG_NONE, 0);
|
||||
|
||||
// update position and orientation for near players
|
||||
WorldPacket data;
|
||||
BuildHeartBeatMsg(&data);
|
||||
SendMessageToSet(&data, false);
|
||||
SendHeartBeat(false);
|
||||
}
|
||||
|
||||
void Unit::SetFeared(bool apply, uint64 const& casterGUID, uint32 spellID, uint32 time)
|
||||
|
|
@ -10398,9 +10384,8 @@ void Unit::NearTeleportTo( float x, float y, float z, float orientation, bool ca
|
|||
|
||||
GetMap()->CreatureRelocation((Creature*)this, x, y, z, orientation);
|
||||
|
||||
WorldPacket data;
|
||||
BuildHeartBeatMsg(&data);
|
||||
SendMessageToSet(&data, false);
|
||||
SendHeartBeat(false);
|
||||
|
||||
// finished relocation, movegen can different from top before creature relocation,
|
||||
// but apply Reset expected to be safe in any case
|
||||
if (!c->GetMotionMaster()->empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue