Skip to content

Core/Battlegrounds: Fix flag captures in Warsong Gulch - #504

Open
Xian55 wants to merge 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
Xian55:fix/wsg-flag-capture
Open

Xian55 wants to merge 1 commit into
The-Cataclysm-Preservation-Project:masterfrom
Xian55:fix/wsg-flag-capture

Conversation

@Xian55

@Xian55 Xian55 commented Oct 17, 2026 •

Copy link
Copy Markdown

Changes proposed:
Fix flag captures in Warsong Gulch.

BattlegroundWS::HandleAreaTrigger lets a flag carrier capture only while his own team's flag is at its base, and tests that as !_flagState[team], which holds for 0. BG_WS_FlagState starts at BG_WS_FLAG_STATE_ON_BASE = 1 and nothing ever stores 0, so a carrier who reaches his flag room (area triggers 3646 / 3647) never scores. The check now compares against BG_WS_FLAG_STATE_ON_BASE.

Twin Peaks has the same check, but its BG_TP_FLAG_STATE_ON_BASE is 0, so it is not affected.

Tests performed: (Does it build, tested in-game, etc)

  • builds (Linux, clang, amd64 and arm64)
  • tested in-game on master + this commit, and without it (0689042, the master before Core/Player: Use the saved zone when loading the inventory #500) for comparison. The run was automated; by hand it is:
    1. A GM account with an Alliance character of level 10 or higher, not in a group.
    2. .debug bg: "Battlegrounds are set to 1v0", so a battle starts with one player.
    3. Queue for Warsong Gulch and enter. Wait for the gates: "Let the battle for Warsong Gulch begin!".
    4. .go xyz 918 1434 346 489 (the Horde flag room) and click the Horde Flag: "The Horde Flag was picked up by ...!", the carrier aura (23333) is on.
    5. .go xyz 1524 1481 354 489 0 (outside the Alliance flag room) and run forward into the room, through area trigger 3646.
      • without the commit: the carrier keeps the flag and the aura, the scoreboard's flag captures stay 0.
      • with this commit: the aura goes, the scoreboard's flag captures go to 1.
    6. Wait for the Horde flag to come back to its room (about 20 seconds) and repeat 4 and 5: captures 2, then 3. After the third the battle ends with Alliance as the winner.
    7. Leave the battle (no Deserter, the battle is over) and .debug bg again to switch it off.
  • the client was connected through HermesProxy/feature/cata-442-client; the capture is decided by the server's area trigger handling alone.

🤖 Generated with Claude Code

The capture check in BattlegroundWS::HandleAreaTrigger tested the
capturing team's own flag with !_flagState[...], which only holds for 0.
BG_WS_FlagState starts at BG_WS_FLAG_STATE_ON_BASE = 1 and nothing ever
stores 0, so the flag carrier reached the flag room and no capture was
ever counted. Test for BG_WS_FLAG_STATE_ON_BASE instead.

Twin Peaks has the same check but numbers its states from 0, so it is
not affected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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