mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-06 20:37:45 +00:00
fix(Core/Movement): properly send movement *ack packets to controlling players. (#7635)
- Closes #7606
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1630323397055182800');
|
||||||
|
|
||||||
|
UPDATE `creature_template` SET `InhabitType`=3 WHERE `entry`=32535;
|
||||||
@@ -2861,6 +2861,20 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/)
|
|||||||
|
|
||||||
applyInhabitFlags();
|
applyInhabitFlags();
|
||||||
|
|
||||||
|
if (m_movedByPlayer)
|
||||||
|
{
|
||||||
|
WorldPacket data(disable ? SMSG_MOVE_GRAVITY_DISABLE : SMSG_MOVE_GRAVITY_ENABLE, 12);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(0); //! movement counter
|
||||||
|
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
|
||||||
|
|
||||||
|
data.Initialize(MSG_MOVE_GRAVITY_CHNG, 64);
|
||||||
|
data << GetPackGUID();
|
||||||
|
BuildMovementPacket(&data);
|
||||||
|
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!movespline->Initialized())
|
if (!movespline->Initialized())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -2943,6 +2957,25 @@ bool Creature::SetCanFly(bool enable, bool /*packetOnly*/ /* = false */)
|
|||||||
if (!Unit::SetCanFly(enable))
|
if (!Unit::SetCanFly(enable))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (m_movedByPlayer)
|
||||||
|
{
|
||||||
|
sScriptMgr->AnticheatSetCanFlybyServer(m_movedByPlayer->ToPlayer(), enable);
|
||||||
|
|
||||||
|
if (!enable)
|
||||||
|
m_movedByPlayer->ToPlayer()->SetFallInformation(time(nullptr), m_movedByPlayer->ToPlayer()->GetPositionZ());
|
||||||
|
|
||||||
|
WorldPacket data(enable ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(0); //! movement counter
|
||||||
|
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
|
||||||
|
|
||||||
|
data.Initialize(MSG_MOVE_UPDATE_CAN_FLY, 64);
|
||||||
|
data << GetPackGUID();
|
||||||
|
BuildMovementPacket(&data);
|
||||||
|
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!movespline->Initialized())
|
if (!movespline->Initialized())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -2965,6 +2998,20 @@ bool Creature::SetWaterWalking(bool enable, bool packetOnly /* = false */)
|
|||||||
if (!packetOnly && !Unit::SetWaterWalking(enable))
|
if (!packetOnly && !Unit::SetWaterWalking(enable))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (m_movedByPlayer)
|
||||||
|
{
|
||||||
|
WorldPacket data(enable ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, 12);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(0); //! movement counter
|
||||||
|
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
|
||||||
|
|
||||||
|
data.Initialize(MSG_MOVE_WATER_WALK, 64);
|
||||||
|
data << GetPackGUID();
|
||||||
|
BuildMovementPacket(&data);
|
||||||
|
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!movespline->Initialized())
|
if (!movespline->Initialized())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -2979,6 +3026,20 @@ bool Creature::SetFeatherFall(bool enable, bool packetOnly /* = false */)
|
|||||||
if (!packetOnly && !Unit::SetFeatherFall(enable))
|
if (!packetOnly && !Unit::SetFeatherFall(enable))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (m_movedByPlayer)
|
||||||
|
{
|
||||||
|
WorldPacket data(enable ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, 12);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(0); //! movement counter
|
||||||
|
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
|
||||||
|
|
||||||
|
data.Initialize(MSG_MOVE_FEATHER_FALL, 64);
|
||||||
|
data << GetPackGUID();
|
||||||
|
BuildMovementPacket(&data);
|
||||||
|
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!movespline->Initialized())
|
if (!movespline->Initialized())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -2995,6 +3056,20 @@ bool Creature::SetHover(bool enable, bool packetOnly /*= false*/)
|
|||||||
|
|
||||||
applyInhabitFlags();
|
applyInhabitFlags();
|
||||||
|
|
||||||
|
if (m_movedByPlayer)
|
||||||
|
{
|
||||||
|
WorldPacket data(enable ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, 12);
|
||||||
|
data << GetPackGUID();
|
||||||
|
data << uint32(0); //! movement counter
|
||||||
|
m_movedByPlayer->ToPlayer()->SendDirectMessage(&data);
|
||||||
|
|
||||||
|
data.Initialize(MSG_MOVE_HOVER, 64);
|
||||||
|
data << GetPackGUID();
|
||||||
|
BuildMovementPacket(&data);
|
||||||
|
m_movedByPlayer->ToPlayer()->SendMessageToSet(&data, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!movespline->Initialized())
|
if (!movespline->Initialized())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user