mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/PacketIO: Rewrite updatefield handling
This commit is contained in:
@@ -90,7 +90,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
|
||||
float z = loc.GetPositionZ();
|
||||
if (GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
|
||||
z += GetPlayer()->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
|
||||
z += GetPlayer()->m_unitData->HoverHeight;
|
||||
|
||||
GetPlayer()->Relocate(loc.GetPositionX(), loc.GetPositionY(), z, loc.GetOrientation());
|
||||
|
||||
@@ -211,7 +211,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||
|
||||
// in friendly area
|
||||
else if (GetPlayer()->IsPvP() && !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
else if (GetPlayer()->IsPvP() && !GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
GetPlayer()->UpdatePvP(false, false);
|
||||
|
||||
// resummon pet
|
||||
@@ -277,7 +277,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPackets::Movement::MoveTeleportAck
|
||||
plMover->CastSpell(plMover, 2479, true);
|
||||
|
||||
// in friendly area
|
||||
else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
else if (plMover->IsPvP() && !plMover->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
plMover->UpdatePvP(false, false);
|
||||
}
|
||||
|
||||
@@ -321,8 +321,8 @@ void WorldSession::HandleMovementOpcode(OpcodeClient opcode, MovementInfo& movem
|
||||
}
|
||||
|
||||
// stop some emotes at player move
|
||||
if (plrMover && (plrMover->GetUInt32Value(UNIT_NPC_EMOTESTATE) != 0))
|
||||
plrMover->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
if (plrMover && (plrMover->GetEmoteState() != 0))
|
||||
plrMover->SetEmoteState(EMOTE_ONESHOT_NONE);
|
||||
|
||||
/* handle special cases */
|
||||
if (!movementInfo.transport.guid.IsEmpty())
|
||||
@@ -428,7 +428,7 @@ void WorldSession::HandleMovementOpcode(OpcodeClient opcode, MovementInfo& movem
|
||||
/// @todo discard movement packets after the player is rooted
|
||||
if (plrMover->IsAlive())
|
||||
{
|
||||
plrMover->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
plrMover->AddPlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
plrMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
|
||||
// player can be alive if GM/etc
|
||||
// change the death state to CORPSE to prevent the death timer from
|
||||
@@ -439,7 +439,7 @@ void WorldSession::HandleMovementOpcode(OpcodeClient opcode, MovementInfo& movem
|
||||
}
|
||||
}
|
||||
else
|
||||
plrMover->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
plrMover->RemovePlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
|
||||
if (opcode == CMSG_MOVE_JUMP)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user