fix(Core/Movement): rework root protocol with ack in mind (#23147)

This commit is contained in:
killerwife
2025-10-11 18:49:43 +02:00
committed by GitHub
parent bc89aa561c
commit 31b11d0d11
10 changed files with 86 additions and 143 deletions

View File

@@ -4431,12 +4431,6 @@ void Player::SetMovement(PlayerMovementType pType)
const PackedGuid& guid = GetPackGUID();
switch (pType)
{
case MOVE_ROOT:
data.Initialize(SMSG_FORCE_MOVE_ROOT, guid.size() + 4);
break;
case MOVE_UNROOT:
data.Initialize(SMSG_FORCE_MOVE_UNROOT, guid.size() + 4);
break;
case MOVE_WATER_WALK:
data.Initialize(SMSG_MOVE_WATER_WALK, guid.size() + 4);
break;
@@ -4490,10 +4484,10 @@ void Player::BuildPlayerRepop()
SetHealth(1); // convert player body to ghost
SetMovement(MOVE_WATER_WALK);
SetWaterWalking(true);
if (!GetSession()->isLogingOut())
{
SetMovement(MOVE_UNROOT);
}
if (!IsImmobilizedState())
SendMoveRoot(false);
RemoveUnitFlag(UNIT_FLAG_SKINNABLE); // BG - remove insignia related
int32 corpseReclaimDelay = CalculateCorpseReclaimDelay();
if (corpseReclaimDelay >= 0)
@@ -4530,7 +4524,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
setDeathState(DeathState::Alive);
SetMovement(MOVE_LAND_WALK);
SetMovement(MOVE_UNROOT);
SendMoveRoot(false);
SetWaterWalking(false);
m_deathTimer = 0;
@@ -4594,7 +4588,7 @@ void Player::KillPlayer()
if (IsFlying() && !GetTransport())
GetMotionMaster()->MoveFall();
SetMovement(MOVE_ROOT);
SendMoveRoot(true);
StopMirrorTimers(); //disable timers(bars)
@@ -11703,9 +11697,6 @@ void Player::SendInitialPacketsAfterAddToMap()
GetZoneAndAreaId(newzone, newarea);
UpdateZone(newzone, newarea); // also call SendInitWorldStates();
if (HasStunAura())
SetMovement(MOVE_ROOT);
WorldPacket setCompoundState(SMSG_MULTIPLE_MOVES, 100);
setCompoundState << uint32(0); // size placeholder