Skip to content

feat(WG): add CFBG.Battlefield.SkipClasses to keep classes native - #169

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:feat/wg-skip-classes
Jun 22, 2026
Merged

feat(WG): add CFBG.Battlefield.SkipClasses to keep classes native#169
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:feat/wg-skip-classes

Conversation

@Nyeriah

@Nyeriah Nyeriah commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

Adds CFBG.Battlefield.SkipClasses, a comma-separated list of class IDs excluded from Wintergrasp cross-faction selection. Players of a listed class always keep their native faction and are never morphed or reassigned by CFBG.

Why

Some classes are faction-flavor sensitive (e.g. a server may want Shamans/Paladins to stay on their lore faction in WG). This gives operators per-class control without disabling crossfaction WG entirely.

How

  • Parsed once in LoadConfig into an unordered_set<uint8> via Acore::Tokenize + StringTo<uint8>.
  • OnBattlefieldPlayerJoinWar returns early for listed classes, so no team lock or fake race/morph is applied.
  • Empty by default (no class skipped); affects Wintergrasp only, not regular battlegrounds.

Class IDs: 1 Warrior, 2 Paladin, 3 Hunter, 4 Rogue, 5 Priest, 6 Death Knight, 7 Shaman, 8 Mage, 9 Warlock, 11 Druid. Example: CFBG.Battlefield.SkipClasses = "5,6,7".

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Introduced a new configuration setting to exclude specific player classes from cross-faction morphing in Wintergrasp. Classes specified in this option will retain their native faction assignment instead of being morphed to the opposing faction. This feature requires the cross-faction battlefield system to be enabled.

Adds a config list of class IDs excluded from Wintergrasp cross-faction
selection. Players of a listed class always keep their native faction and
are never morphed or reassigned by CFBG. Parsed once in LoadConfig into a
set; OnBattlefieldPlayerJoinWar returns early for listed classes so no team
lock or fake is applied. Empty by default (no class skipped).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 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: 01ad0e2f-ba14-46c8-a4bc-dc7b74c2965f

📥 Commits

Reviewing files that changed from the base of the PR and between 9da4cf6 and 3196332.

📒 Files selected for processing (4)
  • conf/CFBG.conf.dist
  • src/CFBG.cpp
  • src/CFBG.h
  • src/CFBG_SC.cpp

📝 Walkthrough

Walkthrough

A new CFBG.Battlefield.SkipClasses configuration option is added that accepts a comma-separated list of player class IDs. During LoadConfig(), the list is parsed into an _wgSkipClasses unordered set. In the Wintergrasp war-join hook, players whose class is in that set skip cross-faction team assignment and morph application entirely.

Changes

Wintergrasp Skip-Class Feature

Layer / File(s) Summary
Data contract and configuration definition
src/CFBG.h, conf/CFBG.conf.dist
Adds <unordered_set> include, IsWGSkipClass(uint8 playerClass) const public method, and _wgSkipClasses private member to CFBG; adds the CFBG.Battlefield.SkipClasses config key with a documentation block and default empty value.
Config parsing and hook enforcement
src/CFBG.cpp, src/CFBG_SC.cpp
LoadConfig() tokenizes CFBG.Battlefield.SkipClasses and populates _wgSkipClasses; OnBattlefieldPlayerJoinWar gains an early-return guard that skips morph/team reassignment for any player class present in that set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A bunny hops through Wintergrasp's gate,
Some classes skip the morph — that's just their fate!
🐇 Parse the config, fill the set with care,
Return early, leave their faction bare.
No disguise for those on the skip list today,
The cross-realm magic simply hops away! ✨

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

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

@Nyeriah
Nyeriah merged commit ad08dd7 into azerothcore:master Jun 22, 2026
0 of 2 checks 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