diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 304f1277c0d..88d43c04c13 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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); } diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 01767717c5a..97e3a4dd122 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -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(); }