diff options
author | maximius <none@none> | 2009-09-11 16:25:11 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-11 16:25:11 -0700 |
commit | 2bb0c319789c893255d94556bd8a819f96be0c0d (patch) | |
tree | 8ac2b7dded072fce9ff871b4ffc7990b018143cb /src/game/BattleGroundAB.cpp | |
parent | 996fcc967f05e304cc0e51bb4e0dd2d5a0de17c9 (diff) |
*[8474] Allow to delete BattleGround objects when any of invited players didn't click to enter battle. Rename m_TeamScores500disadvantage to m_TeamScores500Disadvantage, and optimize its update. Patch is tested. Author: Triply
*Added some missed changes that might of broken compile in the last 2~ commits.
*Some fixes to Warlock's Death Coil by Gyullo.
*Last MaNGOS merge until KingPin says otherwise..
--HG--
branch : trunk
Diffstat (limited to 'src/game/BattleGroundAB.cpp')
-rw-r--r-- | src/game/BattleGroundAB.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp index 70709af42ad..a6e9e9b97d7 100644 --- a/src/game/BattleGroundAB.cpp +++ b/src/game/BattleGroundAB.cpp @@ -158,21 +158,14 @@ void BattleGroundAB::Update(uint32 diff) UpdateWorldState(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[team]); if (team == BG_TEAM_HORDE) UpdateWorldState(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[team]); + // update achievement flags + // we increased m_TeamScores[team] so we just need to check if it is 500 more than other teams resources + uint8 otherTeam = (team + 1) % BG_TEAMS_COUNT; + if (m_TeamScores[team] > m_TeamScores[otherTeam] + 500) + m_TeamScores500Disadvantage[otherTeam] = true; } } - // achievements flags - if (m_TeamScores[BG_TEAM_ALLIANCE] > m_TeamScores[BG_TEAM_HORDE]) - { - if (m_TeamScores[BG_TEAM_ALLIANCE] - m_TeamScores[BG_TEAM_HORDE] >= 500) - m_TeamScores500disadvantage[BG_TEAM_HORDE] = true; - } - else - { - if (m_TeamScores[BG_TEAM_HORDE] - m_TeamScores[BG_TEAM_ALLIANCE] >= 500) - m_TeamScores500disadvantage[BG_TEAM_ALLIANCE] = true; - } - // Test win condition if (m_TeamScores[BG_TEAM_ALLIANCE] >= BG_AB_MAX_TEAM_SCORE) EndBattleGround(ALLIANCE); @@ -603,8 +596,8 @@ void BattleGroundAB::Reset() bool isBGWeekend = false; //TODO FIXME - call sBattleGroundMgr.IsBGWeekend(m_TypeID); - you must also implement that call! m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks; m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks; - m_TeamScores500disadvantage[BG_TEAM_ALLIANCE] = false; - m_TeamScores500disadvantage[BG_TEAM_HORDE] = false; + m_TeamScores500Disadvantage[BG_TEAM_ALLIANCE] = false; + m_TeamScores500Disadvantage[BG_TEAM_HORDE] = false; for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) { |