Skip to content

Core/Packets: Fix SMSG_SPELL_DAMAGE_SHIELD GUID order - #505

Open
Xian55 wants to merge 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
Xian55:fix/spell-damage-shield-guid-order
Open

Xian55 wants to merge 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
Xian55:fix/spell-damage-shield-guid-order

Conversation

@Xian55

@Xian55 Xian55 commented Oct 24, 2026

Copy link
Copy Markdown

Changes proposed:
Fix the GUID order of SMSG_SPELL_DAMAGE_SHIELD.

SpellDamageShield::Write writes Defender first and Attacker second. Unit::DealMeleeDamage fills them as:

  • Attacker = victim->GetGUID(): the unit that was struck in melee and owns the damage shield;
  • Defender = GetGUID(): the unit that swung and gets hit by the shield.

The 4.3.4.15595 client reads them the other way round. Its handler for the opcode reads guid, guid, spell, damage, overkill, school, absorbed and builds the DAMAGE_SHIELD combat log entry with the first GUID as the source and the second as the destination. The same code takes the damage off the second unit's health. So every damage shield was logged the wrong way round: the player who struck a Retribution Aura showed as the aura's source, and its owner as the one it hit.

Write now sends Attacker first, which is also the 3.3.5 order (victim first).

Tests performed: (Does it build, tested in-game, etc)

  • builds (Linux, clang, amd64 and arm64)
  • tested in-game on a build of master with Core/Battlegrounds: Fix flag captures in Warsong Gulch #504 and this commit, and for comparison on the same build without this commit. The run was automated; by hand it is:
    1. A GM account, any character, away from other creatures.
    2. .npc add temp 44614 (Training Dummy) and target it.
    3. .aura 7294 (Retribution Aura) on the dummy. .aura 17545 (Greater Holy Protection) too, if the absorb should show.
    4. Attack the dummy in melee.
      • without the commit: the combat log has DAMAGE_SHIELD with the player as the source and the dummy as the destination.
      • with this commit: the dummy is the source (its Retribution Aura) and the player the destination, with the absorbed amount when step 3 added Greater Holy Protection.
    5. .npc delete the dummy.
  • the client was a 4.4.2 one, connected through HermesProxy, which passes the two GUIDs on in the order the server sends them. The order the 4.3.4 client expects comes from its own handler for the opcode (above). The fix was not played with a native 4.3.4 client.

🤖 Generated with Claude Code

The 4.3.4.15595 client reads the two GUIDs of SMSG_SPELL_DAMAGE_SHIELD
as the shield's owner and then the unit the shield struck. Its handler
logs DAMAGE_SHIELD with the first GUID as the source, and it takes the
damage off the second GUID's health.

SpellDamageShield::Write wrote Defender (the unit that swung,
Unit::DealMeleeDamage's this) first and Attacker (the victim that owns
the shield) second. Every damage shield was therefore logged the wrong
way round: the player who hit a Retribution Aura showed as its source,
and the shield's owner as the unit it hit.

Write Attacker first, as 3.3.5 does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant