Skip to content

Use module WG tracking and add battlefield hooks#135

Merged
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:wintergras
Mar 2, 2026
Merged

Use module WG tracking and add battlefield hooks#135
Nyeriah merged 1 commit into
azerothcore:masterfrom
Nyeriah:wintergras

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented Mar 2, 2026

Replace reliance on core GetPlayersInWarCount() with a module-owned _wgWarPlayers set for WorldGuard (WG) balancing, and add battlefield hooks to manage fake-team assignment lifecycle. Changes: add BATTLEFIELDHOOK_ON_PLAYER_ENTER_ZONE and BATTLEFIELDHOOK_ON_PLAYER_LEAVE_WAR; implement OnBattlefieldPlayerEnterZone to assign an alternate team only during active war (and skip already-faked players); implement OnBattlefieldPlayerJoinWar to handle fallback assignments and to insert players into _wgWarPlayers when they accept invites; implement OnBattlefieldPlayerLeaveWar to remove players from _wgWarPlayers; update OnBattlefieldPlayerLeaveZone to clear fake players and perform a safe GUID erase as a catch-all. These changes ensure balance decisions are based on clean, module-maintained state and avoid leaving stale entries in core battlefield structures.

Replace reliance on core GetPlayersInWarCount() with a module-owned _wgWarPlayers set for WorldGuard (WG) balancing, and add battlefield hooks to manage fake-team assignment lifecycle. Changes: add BATTLEFIELDHOOK_ON_PLAYER_ENTER_ZONE and BATTLEFIELDHOOK_ON_PLAYER_LEAVE_WAR; implement OnBattlefieldPlayerEnterZone to assign an alternate team only during active war (and skip already-faked players); implement OnBattlefieldPlayerJoinWar to handle fallback assignments and to insert players into _wgWarPlayers when they accept invites; implement OnBattlefieldPlayerLeaveWar to remove players from _wgWarPlayers; update OnBattlefieldPlayerLeaveZone to clear fake players and perform a safe GUID erase as a catch-all. These changes ensure balance decisions are based on clean, module-maintained state and avoid leaving stale entries in core battlefield structures.
@Nyeriah Nyeriah merged commit 5472bb9 into azerothcore:master Mar 2, 2026
1 check 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