aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-31 11:34:38 +0800
committermegamage <none@none>2009-07-31 11:34:38 +0800
commitd96642c92fbeab49ae613a78c3fb578934288d2f (patch)
tree673a8e3594b82b6c0abfd0294851810a6426c892
parented995581af21754e3b7e66daa50f8da1e38d3760 (diff)
[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 <der-coole-carl@gmx.net> --HG-- branch : trunk
-rw-r--r--src/game/BattleGround.cpp3
-rw-r--r--src/game/BattleGround.h3
-rw-r--r--src/game/BattleGroundAB.h1
-rw-r--r--src/game/BattleGroundEY.h1
-rw-r--r--src/game/BattleGroundWS.h1
5 files changed, 6 insertions, 3 deletions
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index f1825fe805c..c0af8af0e16 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -182,6 +182,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 509ba6eb972..2d7419e8798 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -514,6 +514,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 1c4a6d3b738..876f17b47ba 100644
--- a/src/game/BattleGroundAB.h
+++ b/src/game/BattleGroundAB.h
@@ -285,7 +285,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 a22d6ecc6db..2d0377ed8b2 100644
--- a/src/game/BattleGroundEY.h
+++ b/src/game/BattleGroundEY.h
@@ -369,7 +369,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 7395c3a5bb9..a404b36d7e3 100644
--- a/src/game/BattleGroundWS.h
+++ b/src/game/BattleGroundWS.h
@@ -205,7 +205,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];