fix(Core/Packets): Correct data source for attack stop packet, rewrite to modern class. (#25915)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Jackson
2026-07-23 14:30:57 -04:00
committed by GitHub
parent 878cb1e356
commit dc8c9416dd
6 changed files with 34 additions and 28 deletions
+3 -16
View File
@@ -37,14 +37,14 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
if (!pEnemy)
{
// stop attack state at client
SendAttackStop(nullptr);
_player->SendMeleeAttackStop(nullptr);
return;
}
if (!_player->IsValidAttackTarget(pEnemy))
{
// stop attack state at client
SendAttackStop(pEnemy);
_player->SendMeleeAttackStop(pEnemy);
return;
}
@@ -57,7 +57,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData)
ASSERT(seat);
if (!(seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK))
{
SendAttackStop(pEnemy);
_player->SendMeleeAttackStop(pEnemy);
return;
}
}
@@ -80,16 +80,3 @@ void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& pa
_player->SetSheath(SheathState(packet.CurrentSheathState));
}
void WorldSession::SendAttackStop(Unit const* enemy)
{
WorldPacket data(SMSG_ATTACKSTOP, (8 + 8 + 4)); // we guess size
data << GetPlayer()->GetPackGUID();
if (enemy)
{
data << enemy->GetPackGUID(); // must be packed guid
data << (uint32)enemy->isDead();
}
SendPacket(&data);
}