fix(WG): Credit Slay Them All on any WG-zone kill, war or not#149
Merged
Nyeriah merged 1 commit intoMay 27, 2026
Merged
Conversation
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>
5 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OnBattlefieldPlayerKillpreviously gated all PvP-kill credit onbf->GetPlayersInWarSet(team), but that set is populated only during an active war (filled byBattlefield::OnPlayerJoinWar, cleared byEndBattle). 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.ForEachPlayerInZoneinstead of the war set, keeping the 40y radius.coreCreditonly when the recipient is actually inPlayersInWar[killerTeam](the set core iterates), so non-war kills against a stale-lieutenant victim still get full credit.Test plan
otherCredit).🤖 Generated with Claude Code