fix(WG): re-apply crossfaction fake on resurrect#161
Merged
Nyeriah merged 2 commits intoJun 3, 2026
Conversation
A crossfaction WG player could lose their assigned faction/morph after the ghost->alive transition, reverting to their native race. Re-push the stored fake values on OnPlayerResurrect so the assigned faction and morph survive resurrection. Gated to WG fakes only (enabled system + WG system + player in a BATTLEFIELD_WG zone); battleground fakes remain owned by the BG hooks. SetFactionForRace also re-syncs any controlled pets/summons. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add CFBG.Battlefield.ReapplyOnResurrect.Enable (default 1) so the WG resurrect re-apply can be disabled. Wired through LoadConfig and checked in the OnPlayerResurrect hook alongside the existing WG gates. Co-Authored-By: Claude Opus 4.8 <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.
What
Re-applies a crossfaction Wintergrasp player's fake faction and morph when they resurrect, so they don't revert to their native race/faction after the ghost→alive transition.
Why
A crossfaction WG player assigned to the opposite team is morphed via
setRace/SetDisplayId/SetFaction(stored in_fakePlayerStore). The stored entry survives death, but the resurrection transition can leave the player showing their native race/faction. This re-pushes the stored fake values on resurrect.How
CFBG::ReapplyFakePlayer(Player*)re-applies the storedFakePlayerrace/morph/faction (reuses the existingGetFakePlayerlookup andSetFactionForRace; idempotent).OnPlayerResurrectoverride inCFBG_Player.Player::ResurrectPlayerfires this on every resurrect path (corpse run, spirit-healer, soulstone), so a single hook covers all cases.BATTLEFIELD_WGbattlefield. Battleground fakes remain owned by the BG hooks and are untouched.Config
New option
CFBG.Battlefield.ReapplyOnResurrect.Enable(default1) toggles the behaviour. Documented inCFBG.conf.dist, read inLoadConfig, and checked in the hook alongside the existing WG gates.Pets / summons
SetFactionForRacealready loopsplayer->m_Controlledand re-syncs faction, so any controlled unit alive at resurrect time is covered. Pets re-summoned after resurrection inherit the owner's (fake) faction automatically via core's summon path.Testing
C++ codestyle passes (
apps/codestyle/codestyle-cpp.py).