Skip to content

fix(WG): Credit Slay Them All on any WG-zone kill, war or not#149

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-zone-quest-credit-outside-war
May 27, 2026
Merged

fix(WG): Credit Slay Them All on any WG-zone kill, war or not#149
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-zone-quest-credit-outside-war

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented May 27, 2026

Summary

  • OnBattlefieldPlayerKill previously gated all PvP-kill credit on bf->GetPlayersInWarSet(team), but that set is populated only during an active war (filled by Battlefield::OnPlayerJoinWar, cleared by EndBattle). So outside of war the credit loop iterated empty sets and silently dropped the daily, even though the kill itself fired — honor and promotion work in the same code path.
  • Credit the killer directly so "Slay Them All" (Horde 13180) and "No Mercy for the Merciless" (Alliance 13177/13179) advance on any WG-zone kill, war or not.
  • Propagate assist credit to nearby same-team allies via ForEachPlayerInZone instead of the war set, keeping the 40y radius.
  • Make the core-lieutenant dedup precise: skip coreCredit only when the recipient is actually in PlayersInWar[killerTeam] (the set core iterates), so non-war kills against a stale-lieutenant victim still get full credit.

Test plan

  • Native Horde killer + native Alliance victim outside an active war → Horde quest "Slay Them All" (13180) counter ticks.
  • Native Horde killer + flipped (real-Horde-to-Alliance) victim outside war → Horde quest counter ticks.
  • Both above during an active war → still tick (no regression, no double-counting against lieutenant victims).
  • Crossfaction killer (real-Horde-flipped-to-Alliance) killing a Horde victim → Horde quest counter ticks (via otherCredit).
  • Nearby same-team ally within 40y → also receives assist credit.

🤖 Generated with Claude Code

Previously the OnBattlefieldPlayerKill hook only granted PvP-kill credit
NPCs to players in PlayersInWar[team], which is populated only during an
active war. Outside of war the loop iterated empty sets, so "Slay Them
All" (Horde 13180) and "No Mercy for the Merciless" (Alliance
13177/13179) silently failed to advance even though the kill itself
fired (honor + promotion work in the same path).

Credit the killer directly so the daily advances on any zone kill
regardless of war state, then propagate assist credit to nearby
same-team allies via ForEachPlayerInZone instead of the war set. The
core-lieutenant dedup is now precise: only skip coreCredit when the
recipient is actually in PlayersInWar[killerTeam] (the set core
iterates), so non-war kills against a stale-lieutenant victim still
receive full credit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nyeriah Nyeriah merged commit 064d648 into azerothcore:master May 27, 2026
1 check failed
Nyeriah added a commit to Nyeriah/mod-cfbg that referenced this pull request May 27, 2026
azerothcore#149 credited the killer plus iterated all same-team players in the WG
zone (ForEachPlayerInZone) within 40y on every player kill. The
iteration scales with war population (~100 players in a full WG) and
runs for every kill, including the common non-lieutenant case -- too
costly for a daily-quest credit path.

The killer-direct credit was the actual fix from azerothcore#149 (daily advances
on any WG-zone kill, war or not, and crossfaction players still
advance their original-faction quest via otherCredit). Keep that part
and drop the per-kill iteration.

Lieutenant dedup is now O(1): skip coreCredit only when the victim is a
lieutenant AND the killer is in PlayersInWar[killerTeam] (a single
hash-set count, not a scan). Core's existing lieutenant-only assist
path in BattlefieldWG::HandleKill still fires unchanged for nearby
allies on lieutenant kills.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nyeriah added a commit that referenced this pull request May 27, 2026
#149 credited the killer plus iterated all same-team players in the WG
zone (ForEachPlayerInZone) within 40y on every player kill. The
iteration scales with war population (~100 players in a full WG) and
runs for every kill, including the common non-lieutenant case -- too
costly for a daily-quest credit path.

The killer-direct credit was the actual fix from #149 (daily advances
on any WG-zone kill, war or not, and crossfaction players still
advance their original-faction quest via otherCredit). Keep that part
and drop the per-kill iteration.

Lieutenant dedup is now O(1): skip coreCredit only when the victim is a
lieutenant AND the killer is in PlayersInWar[killerTeam] (a single
hash-set count, not a scan). Core's existing lieutenant-only assist
path in BattlefieldWG::HandleKill still fires unchanged for nearby
allies on lieutenant kills.

Co-authored-by: Claude Opus 4.7 (1M context) <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