Browse files

[s1027] Use GetRatingMultiplier = 1/GetRatingCoefficient instead GetR…

…atingCoefficient

(based on commit 9ec5b1c)
  • Loading branch information...
1 parent e3fdc57 commit 959f944c2a8d6edd9a849788029eedb042af4e03 @Lynx3d Lynx3d committed with VladimirMangos Apr 4, 2011
Showing with 9 additions and 9 deletions.
  1. +7 −7 src/game/Player.cpp
  2. +1 −1 src/game/Player.h
  3. +1 −1 src/shared/revision_nr.h
View
14 src/game/Player.cpp
@@ -4903,22 +4903,22 @@ float Player::GetSpellCritFromIntellect()
return crit*100.0f;
}
-float Player::GetRatingCoefficient(CombatRating cr) const
+float Player::GetRatingMultiplier(CombatRating cr) const
{
uint32 level = getLevel();
if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL;
GtCombatRatingsEntry const *Rating = sGtCombatRatingsStore.LookupEntry(cr*GT_MAX_LEVEL+level-1);
- if (Rating == NULL)
+ if (!Rating)
return 1.0f; // By default use minimum coefficient (not must be called)
- return Rating->ratio;
+ return 1.0f / Rating->ratio;
}
float Player::GetRatingBonusValue(CombatRating cr) const
{
- return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) / GetRatingCoefficient(cr);
+ return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
}
uint32 Player::GetMeleeCritDamageReduction(uint32 damage) const
@@ -5015,20 +5015,20 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
{
case CR_HASTE_MELEE:
{
- float RatingChange = value / GetRatingCoefficient(cr);
+ float RatingChange = value * GetRatingMultiplier(cr);
ApplyAttackTimePercentMod(BASE_ATTACK,RatingChange,apply);
ApplyAttackTimePercentMod(OFF_ATTACK,RatingChange,apply);
break;
}
case CR_HASTE_RANGED:
{
- float RatingChange = value / GetRatingCoefficient(cr);
+ float RatingChange = value * GetRatingMultiplier(cr);
ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply);
break;
}
case CR_HASTE_SPELL:
{
- float RatingChange = value / GetRatingCoefficient(cr);
+ float RatingChange = value * GetRatingMultiplier(cr);
ApplyCastTimePercentMod(RatingChange,apply);
break;
}
View
2 src/game/Player.h
@@ -1638,7 +1638,7 @@ class MANGOS_DLL_SPEC Player : public Unit
float GetSpellCritFromIntellect();
float OCTRegenHPPerSpirit();
float OCTRegenMPPerSpirit();
- float GetRatingCoefficient(CombatRating cr) const;
+ float GetRatingMultiplier(CombatRating cr) const;
float GetRatingBonusValue(CombatRating cr) const;
uint32 GetMeleeCritDamageReduction(uint32 damage) const;
uint32 GetRangedCritDamageReduction(uint32 damage) const;
View
2 src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "1026"
+ #define REVISION_NR "1027"
#endif // __REVISION_NR_H__

0 comments on commit 959f944

Please sign in to comment.