Merge pull request #2915 from idostyle/armorPen

Core/Mechanics: Cap armorPen to maxArmorPen - prevents having armor penetration rating greater than 100%.
This commit is contained in:
QAston
2011-09-22 02:03:14 -07:00
+1 -1
View File
@@ -1584,7 +1584,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
// Figure out how much armor do we ignore // Figure out how much armor do we ignore
float armorPen = CalculatePctF(maxArmorPen, ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION)); float armorPen = CalculatePctF(maxArmorPen, ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION));
// Got the value, apply it // Got the value, apply it
armor -= armorPen; armor -= std::min(armorPen, maxArmorPen);
} }
if (armor < 0.0f) if (armor < 0.0f)