Skip to content

Commit

Permalink
Move GetTeamIndexByTeamId to SharedDefines.h
Browse files Browse the repository at this point in the history
Signed-off-by: Xfurry <xfurry.cmangos@outlook.com>
  • Loading branch information
Zakamurite authored and xfurry committed Jan 7, 2018
1 parent 2770c3e commit 985f40a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/game/BattleGround/BattleGround.h
Expand Up @@ -441,7 +441,6 @@ class BattleGround

virtual void UpdatePlayerScore(Player* Source, uint32 type, uint32 value);

static PvpTeamIndex GetTeamIndexByTeamId(Team team) { return team == ALLIANCE ? TEAM_INDEX_ALLIANCE : TEAM_INDEX_HORDE; }
uint32 GetPlayersCountByTeam(Team team) const { return m_PlayersCount[GetTeamIndexByTeamId(team)]; }
uint32 GetAlivePlayersCountByTeam(Team team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
void UpdatePlayersCountByTeam(Team team, bool remove)
Expand Down
2 changes: 1 addition & 1 deletion src/game/BattleGround/BattleGroundMgr.cpp
Expand Up @@ -322,7 +322,7 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
// mostly people with the highest levels are in battlegrounds, thats why
// we count from MAX_BATTLEGROUND_QUEUES - 1 to 0
// variable index removes useless searching in other team's queue
uint32 index = BattleGround::GetTeamIndexByTeamId(group->GroupTeam);
uint32 index = GetTeamIndexByTeamId(group->GroupTeam);

for (int8 bracket_id_tmp = MAX_BATTLEGROUND_BRACKETS - 1; bracket_id_tmp >= 0 && bracket_id == -1; --bracket_id_tmp)
{
Expand Down
2 changes: 2 additions & 0 deletions src/game/Globals/SharedDefines.h
Expand Up @@ -622,6 +622,8 @@ enum PvpTeamIndex

#define PVP_TEAM_COUNT 2

static inline PvpTeamIndex GetTeamIndexByTeamId(Team team) { return team == ALLIANCE ? TEAM_INDEX_ALLIANCE : TEAM_INDEX_HORDE; }

enum SpellEffects
{
SPELL_EFFECT_NONE = 0,
Expand Down

0 comments on commit 985f40a

Please sign in to comment.