aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 563993fa3d8..a94b58868ee 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5848,31 +5848,35 @@ float Player::OCTRegenMPPerSpirit()
void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
{
- m_baseRatingValue[cr] += (apply ? value : -value);
-
+ float oldRating = m_baseRatingValue[cr];
+ m_baseRatingValue[cr]+=(apply ? value : -value);
// explicit affected values
- float const mult = GetRatingMultiplier(cr);
- float const oldVal = m_baseRatingValue[cr] * mult;
- float const newVal = m_baseRatingValue[cr] * mult;
-
- switch (cr)
- {
- case CR_HASTE_MELEE:
- ApplyAttackTimePercentMod(BASE_ATTACK, oldVal, false);
- ApplyAttackTimePercentMod(OFF_ATTACK, oldVal, false);
- ApplyAttackTimePercentMod(BASE_ATTACK, newVal, true);
- ApplyAttackTimePercentMod(OFF_ATTACK, newVal, true);
- break;
- case CR_HASTE_RANGED:
- ApplyAttackTimePercentMod(RANGED_ATTACK, oldVal, false);
- ApplyAttackTimePercentMod(RANGED_ATTACK, newVal, true);
- break;
- case CR_HASTE_SPELL:
- ApplyCastTimePercentMod(oldVal, false);
- ApplyCastTimePercentMod(newVal, true);
- break;
- default: // shut up compiler warnings
- break;
+ if (cr == CR_HASTE_MELEE || cr == CR_HASTE_RANGED || cr == CR_HASTE_SPELL)
+ {
+ float const mult = GetRatingMultiplier(cr);
+ float const oldVal = oldRating * mult;
+ float const newVal = m_baseRatingValue[cr] * mult;
+ switch (cr)
+ {
+ case CR_HASTE_MELEE:
+ ApplyAttackTimePercentMod(BASE_ATTACK, oldVal, false);
+ ApplyAttackTimePercentMod(OFF_ATTACK, oldVal, false);
+ ApplyAttackTimePercentMod(BASE_ATTACK, newVal, true);
+ ApplyAttackTimePercentMod(OFF_ATTACK, newVal, true);
+ if (getClass() == CLASS_DEATH_KNIGHT)
+ UpdateAllRunesRegen();
+ break;
+ case CR_HASTE_RANGED:
+ ApplyAttackTimePercentMod(RANGED_ATTACK, oldVal, false);
+ ApplyAttackTimePercentMod(RANGED_ATTACK, newVal, true);
+ break;
+ case CR_HASTE_SPELL:
+ ApplyCastTimePercentMod(oldVal, false);
+ ApplyCastTimePercentMod(newVal, true);
+ break;
+ default: // shut up compiler warnings
+ break;
+ }
}
UpdateRating(cr);