Core/Movement: ported client control logic updates from 335 branch

This commit is contained in:
Ovahlord committed 2021-11-06 23:41:34 +01:00
1 parent f5342061ba
commit edbbeba5a2
21 files changed
+464 -284

No files matched your search

@@ -5535,7 +5535,7 @@ bool Movement::PrintInvalidSequenceElement(MovementStatusElements const element,
Movement::PacketSender::PacketSender(Unit* unit, uint16 serverControl, uint16 playerControl, uint16 broadcast /*= SMSG_PLAYER_MOVE*/, ExtraMovementStatusElement* extras /*= nullptr*/)
: _extraElements(extras), _unit(unit)
{
if (unit->GetTypeId() == TYPEID_PLAYER && unit->ToPlayer()->m_unitMovedByMe->GetTypeId() == TYPEID_PLAYER)
if (unit->IsPlayer() && unit->IsMovedByClient())
{
_selfOpcode = playerControl;
_broadcast = broadcast;
@@ -5552,7 +5552,7 @@ void Movement::PacketSender::Send() const
bool isPlayerMovement = false;
if (Player* player = _unit->ToPlayer())
{
isPlayerMovement = player->m_unitMovedByMe->GetTypeId() == TYPEID_PLAYER;
isPlayerMovement = player->IsMovedByClient();
if (isPlayerMovement && _selfOpcode != NULL_OPCODE)
{
WorldPacket data(_selfOpcode);