Skip to content

fix: wg war team and lifecycle - #178

Merged
FrancescoBorzi merged 4 commits into
masterfrom
fix-wg-war-team-and-lifecycle
Jul 2, 2026
Merged

fix: wg war team and lifecycle#178
FrancescoBorzi merged 4 commits into
masterfrom
fix-wg-war-team-and-lifecycle

Conversation

@FrancescoBorzi

Copy link
Copy Markdown

No description provided.

With an empty zone and trickle joins the first accepter latches a 1/0
census, whose floored fair share (1+0)/2 = 0 made every majority joiner
flip: three same-faction players ended up 0v3 on the wrong side. The
fair share is now a ceiling, so the lone first accepter counts as fair
share and stays native, and past the fair share a majority joiner flips
only when his real side currently outnumbers the other in the live war
sets; on a tie he stays native.
Core keys the war vacancy gate, kick and invite bookings and the
Players[] insert on GetTeamId(), which for a war-locked flipped player
returning to the zone is still the REAL team until the join-war hook
re-fakes him. That mis-keyed him against the wrong side's cap: a
wrongful 10s battlefield-full kick when his real side was full, or
overfilling a side past Wintergrasp.PlayerMax.

Handle the enter-zone hook, which core fires before any of those
containers are consulted, and re-fake a war-locked player there. Also
stop fresh assignments from flipping into a side already at
Wintergrasp.PlayerMax; stored locks are honored unchanged.
EndBattleground restores every player's real identity, but a
cross-faction player who dies at the victory screen and reclaims within
the WAIT_LEAVE window went through the resurrect reconciliation, which
re-faked him for the rest of the window. Early-return on WAIT_LEAVE
exactly; entry-time calls run at WAIT_JOIN or IN_PROGRESS and the
in-progress resurrect reapply is unaffected.
Disabling CFBG.Enable and running .reload config early-returned out of
LoadConfig, stranding every online faked player cross-faction until
relog and orphaning the Player*-keyed store entries, which can corrupt
a later Player object reusing the same address.

On a true to false transition, restore every online faked player and
wholesale-clear all four Player*-keyed stores without dereferencing
stored keys (a faked player who logged out mid-war may have left a
dangling key). Also give _IsEnableSystem an initializer so the
transition read is well-defined on the first load; startup never runs
the sweep.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@FrancescoBorzi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a283cbff-46f9-4e14-be11-3c34dde94c40

📥 Commits

Reviewing files that changed from the base of the PR and between 902f3af and 00c50e8.

📒 Files selected for processing (3)
  • src/CFBG.cpp
  • src/CFBG.h
  • src/CFBG_SC.cpp
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-wg-war-team-and-lifecycle

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.

@FrancescoBorzi
FrancescoBorzi merged commit e92dce7 into master Jul 2, 2026
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