mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/PacketIO: update some combat packets to new system (#24236)
(cherry picked from commit af6d207add)
This commit is contained in:
@@ -21710,16 +21710,21 @@ void Player::SetUInt32ValueInArray(Tokenizer& Tokenizer, uint16 index, uint32 va
|
||||
Tokenizer[index] = buf;
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingDeadTarget() const
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::DeadTarget).Write());
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingCantAttack() const
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::CantAttack).Write());
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingCancelAttack() const
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Combat::CancelCombat().Write());
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingDeadTarget() const
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::DeadTarget).Write());
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingNotInRange() const
|
||||
{
|
||||
SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::NotInRange).Write());
|
||||
@@ -21730,16 +21735,10 @@ void Player::SendAttackSwingBadFacingAttack() const
|
||||
SendDirectMessage(WorldPackets::Combat::AttackSwingError(WorldPackets::Combat::AttackSwingError::BadFacing).Write());
|
||||
}
|
||||
|
||||
void Player::SendAttackSwingCancelAttack() const
|
||||
{
|
||||
WorldPackets::Combat::CancelCombat packet;
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void Player::SendAutoRepeatCancel(Unit* target)
|
||||
{
|
||||
WorldPackets::Combat::CancelAutoRepeat cancelAutoRepeat;
|
||||
cancelAutoRepeat.Guid = target->GetGUID(); // may be it's target guid
|
||||
cancelAutoRepeat.Guid = target->GetGUID(); // may be it's target guid
|
||||
SendMessageToSet(cancelAutoRepeat.Write(), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPackets::Combat::AttackSwing& pa
|
||||
return;
|
||||
}
|
||||
|
||||
//! Client explicitly checks the following before sending CMSG_ATTACKSWING packet,
|
||||
//! Client explicitly checks the following before sending CMSG_ATTACK_SWING packet,
|
||||
//! so we'll place the same check here. Note that it might be possible to reuse this snippet
|
||||
//! in other places as well.
|
||||
if (Vehicle* vehicle = _player->GetVehicle())
|
||||
@@ -60,7 +60,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPackets::Combat::AttackSwing& pa
|
||||
_player->Attack(enemy, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleAttackStopOpcode(WorldPackets::Combat::AttackStop& /*recvData*/)
|
||||
void WorldSession::HandleAttackStopOpcode(WorldPackets::Combat::AttackStop& /*packet*/)
|
||||
{
|
||||
GetPlayer()->AttackStop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user