Warsong Gulch: In tie case last captured flag decides instead of first

Patch by manisamja
Closes issue #2925

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-07-12 11:42:57 +02:00
parent 67268befcd
commit 7a8d464b19
2 changed files with 7 additions and 7 deletions

View File

@@ -83,8 +83,8 @@ void BattleGroundWS::Update(uint32 diff)
else if (GetTeamScore(HORDE) == 0)
EndBattleGround(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the first flag
EndBattleGround(m_FirstFlagCaptureTeam);
else if (GetTeamScore(HORDE) == GetTeamScore(ALLIANCE)) // Team score equal, winner is team that scored the last flag
EndBattleGround(m_LastFlagCaptureTeam);
else if (GetTeamScore(HORDE) > GetTeamScore(ALLIANCE)) // Last but not least, check who has the higher score
EndBattleGround(HORDE);
@@ -325,8 +325,8 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
// only flag capture should be updated
UpdatePlayerScore(Source, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
if (!m_FirstFlagCaptureTeam)
SetFirstFlagCapture(Source->GetTeam());
// update last flag capture to be used if teamscore is equal
SetLastFlagCapture(Source->GetTeam());
if (GetTeamScore(ALLIANCE) == BG_WS_MAX_TEAM_SCORE)
winner = ALLIANCE;
@@ -720,7 +720,7 @@ void BattleGroundWS::Reset()
m_HonorEndKills = (isBGWeekend) ? 4 : 2;
// For WorldState
m_minutesElapsed = 0;
m_FirstFlagCaptureTeam = 0;
m_LastFlagCaptureTeam = 0;
/* Spirit nodes is static at this BG and then not required deleting at BG reset.
if (m_BgCreatures[WS_SPIRIT_MAIN_ALLIANCE])

View File

@@ -191,7 +191,7 @@ class BattleGroundWS : public BattleGround
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
void UpdateFlagState(uint32 team, uint32 value);
void SetFirstFlagCapture(uint32 team) { m_FirstFlagCaptureTeam = team; }
void SetLastFlagCapture(uint32 team) { m_LastFlagCaptureTeam = team; }
void UpdateTeamScore(uint32 team);
void UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor = true);
void SetDroppedFlagGUID(uint64 guid, uint32 TeamID) { m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)] = guid;}
@@ -209,7 +209,7 @@ class BattleGroundWS : public BattleGround
uint8 m_FlagState[2]; // for checking flag state
int32 m_FlagsTimer[2];
int32 m_FlagsDropTimer[2];
uint32 m_FirstFlagCaptureTeam; // Winner is based on this if score is equal
uint32 m_LastFlagCaptureTeam; // Winner is based on this if score is equal
uint32 m_ReputationCapture;
uint32 m_HonorWinKills;