Skip to content

fix(WG): credit Victory in Wintergrasp for crossfaction players - #181

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-victory-quest-crossfaction
Jul 19, 2026
Merged

fix(WG): credit Victory in Wintergrasp for crossfaction players#181
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:fix/wg-victory-quest-crossfaction

Conversation

@Nyeriah

@Nyeriah Nyeriah commented Jul 19, 2026

Copy link
Copy Markdown
Member

Problem

Core's BattlefieldWG::OnBattleEnd credits the winning side with a single quest id derived from the defending (winning) team:

player->AreaExploredOrEventHappens(GetDefenderTeam() ? 13183 : 13181);

13181 is the Alliance "Victory in Wintergrasp" (turned in to Tactical Officer Ahbramis), 13183 the Horde one (Tactical Officer Kilrath). A crossfaction player fighting as the opposite side still holds their own faction's copy, so that call does nothing for them and the turn-in never becomes available.

Fix

Grant the other faction's victory quest to everyone in the winning war set from OnBattlefieldWarEnd, which runs before OnBattleEnd while PlayersInWar is still populated and GetDefenderTeam() already reflects the winner.

AreaExploredOrEventHappens is a no-op on a quest the player does not hold, so native players are unaffected and there is no double credit. This mirrors the existing PvP-kill credit handling in OnBattlefieldPlayerKill.

Only runs when both CFBG.Enable and the WG crossfaction system are on.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Wintergrasp victory quest credit for winning players, including cross-faction scenarios.
  • Bug Fixes

    • Fixed missing victory quest event awards when Wintergrasp battles end.
    • Improved post-battle cleanup by clearing temporary players after rewards are processed.

Core's BattlefieldWG::OnBattleEnd credits the winners with a single quest
id derived from the defending (winning) team: 13181 for Alliance, 13183
for Horde. A crossfaction player fighting as the opposite side still
holds their own faction's copy of the quest, so that call does nothing
for them and the turn-in stays unavailable.

Grant the other faction's victory quest to everyone in the winning war
set from OnBattlefieldWarEnd, which runs before OnBattleEnd while
PlayersInWar is still populated. AreaExploredOrEventHappens is a no-op on
a quest the player does not hold, so native players are unaffected and
there is no double credit.

Same approach as the PvP-kill credit fix in OnBattlefieldPlayerKill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Nyeriah
Nyeriah merged commit 78771c6 into azerothcore:master Jul 19, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e71b33b3-92c1-4b72-9967-f75f231c8c99

📥 Commits

Reviewing files that changed from the base of the PR and between 81dc925 and 80db690.

📒 Files selected for processing (1)
  • src/CFBG_SC.cpp

📝 Walkthrough

Walkthrough

Wintergrasp war-end processing now triggers the appropriate victory quest event for winners across both participant sets and clears fake players during cleanup.

Changes

Wintergrasp war-end handling

Layer / File(s) Summary
War-end quest and cleanup processing
src/CFBG_SC.cpp
Adds Alliance and Horde victory quest IDs, awards the alternate victory quest event to winning participants, and clears fake players from both war sets.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: francescoborzi

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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