From d8c1e3991ff5ceca6d584ce1971a65ea2885ea1a Mon Sep 17 00:00:00 2001 From: balrok Date: Wed, 29 Jul 2009 14:43:05 +0200 Subject: [PATCH] [8274] use virtual m_TeamScore for battlegrounds score is used in every battleground (not arena) so we can use it as a virtual variable to access it also from BattleGround-class Signed-off-by: balrok --- src/game/BattleGround.cpp | 3 +++ src/game/BattleGround.h | 3 +++ src/game/BattleGroundAB.h | 1 - src/game/BattleGroundEY.h | 1 - src/game/BattleGroundWS.h | 1 - src/shared/revision_nr.h | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 0ffc65ed6..0727a7e07 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -178,6 +178,9 @@ BattleGround::BattleGround() m_PlayersCount[BG_TEAM_ALLIANCE] = 0; m_PlayersCount[BG_TEAM_HORDE] = 0; + m_TeamScores[BG_TEAM_ALLIANCE] = 0; + m_TeamScores[BG_TEAM_HORDE] = 0; + m_PrematureCountDown = false; m_PrematureCountDown = 0; diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index 91eb32382..042ce648b 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -499,6 +499,9 @@ class BattleGround void SetDeleteThis() {m_SetDeleteThis = true;} + /* virtual score-array - get's used in bg-subclasses */ + int32 m_TeamScores[BG_TEAMS_COUNT]; + protected: //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround void EndNow(); diff --git a/src/game/BattleGroundAB.h b/src/game/BattleGroundAB.h index b31b1f0f3..bd3796588 100644 --- a/src/game/BattleGroundAB.h +++ b/src/game/BattleGroundAB.h @@ -283,7 +283,6 @@ class BattleGroundAB : public BattleGround uint8 m_prevNodes[BG_AB_DYNAMIC_NODES_COUNT]; BG_AB_BannerTimer m_BannerTimers[BG_AB_DYNAMIC_NODES_COUNT]; uint32 m_NodeTimers[BG_AB_DYNAMIC_NODES_COUNT]; - uint32 m_TeamScores[BG_TEAMS_COUNT]; uint32 m_lastTick[BG_TEAMS_COUNT]; uint32 m_HonorScoreTics[BG_TEAMS_COUNT]; uint32 m_ReputationScoreTics[BG_TEAMS_COUNT]; diff --git a/src/game/BattleGroundEY.h b/src/game/BattleGroundEY.h index 4f9cf1223..8180329cb 100644 --- a/src/game/BattleGroundEY.h +++ b/src/game/BattleGroundEY.h @@ -367,7 +367,6 @@ class BattleGroundEY : public BattleGround void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; } void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; } - uint32 m_TeamScores[2]; uint32 m_HonorScoreTics[2]; uint32 m_TeamPointsCount[2]; diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h index 093da3e53..24ba41253 100644 --- a/src/game/BattleGroundWS.h +++ b/src/game/BattleGroundWS.h @@ -184,7 +184,6 @@ class BattleGroundWS : public BattleGround uint64 m_FlagKeepers[2]; // 0 - alliance, 1 - horde uint64 m_DroppedFlagGUID[2]; uint8 m_FlagState[2]; // for checking flag state - uint32 m_TeamScores[2]; int32 m_FlagsTimer[2]; int32 m_FlagsDropTimer[2]; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5f604ed83..bdb492869 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8273" + #define REVISION_NR "8274" #endif // __REVISION_NR_H__