Skip to content

perf(WG): drop per-kill assist iteration; credit killer only#150

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-quest-credit-killer-direct
May 27, 2026
Merged

perf(WG): drop per-kill assist iteration; credit killer only#150
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-quest-credit-killer-direct

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented May 27, 2026

Summary

Follow-up to #149. That PR fixed the actual bug (Slay Them All not crediting outside an active war) by crediting the killer directly and iterating nearby same-team players in the zone for assist credit. The iteration scales with war population (~100 players in a full WG) and runs on every kill — too costly for a daily-quest credit path.

  • Drop the per-kill ForEachPlayerInZone scan.
  • Keep fix(WG): Credit Slay Them All on any WG-zone kill, war or not #149's actual fix: credit the killer directly so the daily advances on any WG-zone kill, war or not, with both PvP-kill credit NPCs so crossfaction quests advance.
  • Make lieutenant dedup O(1): single hash-set count(killer->GetGUID()) instead of an iteration.
  • Core's existing lieutenant-only assist path in BattlefieldWG::HandleKill still fires unchanged for nearby allies on lieutenant kills.

Net result: same user-visible behavior as #149 for the killer (the only player that must be credited for the daily to advance), at O(1) per kill instead of O(zone-population).

Test plan

  • Native Horde killer + native Alliance victim, outside active war → Horde "Slay Them All" (13180) counter ticks.
  • Native Horde killer + flipped (real-Horde-to-Alliance) victim, outside war → counter ticks.
  • Both above during active war → still tick.
  • Crossfaction killer (real-Horde flipped to Alliance) killing a Horde victim → Horde quest counter ticks (via otherCredit).
  • Lieutenant victim during war → killer credited exactly once (no double-count with core's lieutenant path).

🤖 Generated with Claude Code

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 Nyeriah force-pushed the fix/wg-quest-credit-killer-direct branch from eed965f to 628addc Compare May 27, 2026 02:25
@Nyeriah Nyeriah changed the title fix(WG): Credit Slay Them All on any WG-zone kill, war or not perf(WG): drop per-kill assist iteration; credit killer only May 27, 2026
@Nyeriah Nyeriah merged commit 9f6d1b2 into azerothcore:master May 27, 2026
1 check passed
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