Core/PacketIO: update some combat packets to new system (#24236)

(cherry picked from commit af6d207add)
This commit is contained in:
ForesterDev
2020-03-12 20:06:15 +04:00
committed by Shauren
parent 9b055b98fc
commit 08c61bb9d1
2 changed files with 13 additions and 14 deletions

View File

@@ -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);
}

View File

@@ -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();
}