From e72065780a43401d95db3426f49828d3c6718237 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 6 Sep 2009 22:13:59 -0500 Subject: *Fix the bug that tenacity buff in wintergrasp is not casted correctly. Thanks to drahy. --HG-- branch : trunk --- src/game/Wintergrasp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index 35602251715..153249aed50 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -721,19 +721,19 @@ void OPvPWintergrasp::UpdateTenacityStack() int32 newStack = 0; if(allianceNum && hordeNum) { - if(allianceNum > hordeNum) - newStack = allianceNum / hordeNum - 1; - else if(allianceNum < hordeNum) - newStack = 1 - int32(hordeNum / allianceNum); + if(allianceNum < hordeNum) + newStack = hordeNum / allianceNum - 1; // positive, should cast on alliance + else if(allianceNum > hordeNum) + newStack = 1 - int32(allianceNum / hordeNum); // negative, should cast on horde } if(newStack == m_tenacityStack) return; // Remove old buff - if(m_tenacityStack > 0) + if(m_tenacityStack > 0) // old buff was on alliance { - if(newStack <= 0) + if(newStack <= 0) // new buff should on horde { TeamCastSpell(TEAM_ALLIANCE, -SPELL_TENACITY); VehicleCastSpell(TEAM_ALLIANCE, -SPELL_TENACITY_VEHICLE); @@ -752,7 +752,7 @@ void OPvPWintergrasp::UpdateTenacityStack() // Apply new buff if(newStack) { - TeamId team = newStack > 0 ? TEAM_HORDE : TEAM_ALLIANCE; + TeamId team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE; if(newStack < 0) newStack = -newStack; for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) (*itr)->SetAuraStack(SPELL_TENACITY, *itr, newStack); -- cgit v1.2.3