fix(Core): Correct packet structure for combat stop messages. (#19434)

* Init.

* Reviewed changes.
This commit is contained in:
Benjamin Jackson 2024-07-18 20:19:36 -04:00 committed by GitHub
parent 486cbb3970
commit 295e4dd3c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -3051,10 +3051,12 @@ void Unit::SendMeleeAttackStop(Unit* victim)
WorldPacket data(SMSG_ATTACKSTOP, (8 + 8 + 4));
data << GetPackGUID();
if (victim)
{
uint8 nowDead = victim->isDead();
data << victim->GetPackGUID();
data << victim->isDead();
data << nowDead;
}
SendMessageToSet(&data, true);
LOG_DEBUG("entities.unit", "WORLD: Sent SMSG_ATTACKSTOP");

View file

@ -86,10 +86,12 @@ void WorldSession::SendAttackStop(Unit const* enemy)
{
WorldPacket data(SMSG_ATTACKSTOP, (8 + 8 + 4)); // we guess size
data << GetPlayer()->GetPackGUID();
if (enemy)
{
uint8 nowDead = enemy->isDead();
data << enemy->GetPackGUID(); // must be packed guid
data << enemy->isDead();
data << nowDead;
}
SendPacket(&data);
}