Replace magic numbers with enums

lua_on_mac
Evil Eye 3 years ago committed by jvoisin
parent c166341ec0
commit 6f870a464b

@ -94,6 +94,7 @@
Bug #6493: Unlocking owned but not locked or unlocked containers is considered a crime
Bug #6517: Rotations for KeyframeData in NIFs should be optional
Bug #6519: Effects tooltips for ingredients work incorrectly
Bug #6523: Disintegrate Weapon is resisted by Resist Magicka instead of Sanctuary
Feature #890: OpenMW-CS: Column filtering
Feature #1465: "Reset" argument for AI functions
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record

@ -281,14 +281,12 @@ short MagicEffect::getResistanceEffect(short effect)
effects[DisintegrateArmor] = Sanctuary;
effects[DisintegrateWeapon] = Sanctuary;
for (int i=0; i<5; ++i)
effects[DrainAttribute+i] = ResistMagicka;
for (int i=0; i<5; ++i)
effects[DamageAttribute+i] = ResistMagicka;
for (int i=0; i<5; ++i)
effects[AbsorbAttribute+i] = ResistMagicka;
for (int i=0; i<10; ++i)
effects[WeaknessToFire+i] = ResistMagicka;
for (int i = DrainAttribute; i <= DamageSkill; ++i)
effects[i] = ResistMagicka;
for (int i = AbsorbAttribute; i <= AbsorbSkill; ++i)
effects[i] = ResistMagicka;
for (int i = WeaknessToFire; i <= WeaknessToNormalWeapons; ++i)
effects[i] = ResistMagicka;
effects[Burden] = ResistMagicka;
effects[Charm] = ResistMagicka;
@ -326,14 +324,12 @@ short MagicEffect::getWeaknessEffect(short effect)
static std::map<short, short> effects;
if (effects.empty())
{
for (int i=0; i<5; ++i)
effects[DrainAttribute+i] = WeaknessToMagicka;
for (int i=0; i<5; ++i)
effects[DamageAttribute+i] = WeaknessToMagicka;
for (int i=0; i<5; ++i)
effects[AbsorbAttribute+i] = WeaknessToMagicka;
for (int i=0; i<10; ++i)
effects[WeaknessToFire+i] = WeaknessToMagicka;
for (int i = DrainAttribute; i <= DamageSkill; ++i)
effects[i] = WeaknessToMagicka;
for (int i = AbsorbAttribute; i <= AbsorbSkill; ++i)
effects[i] = WeaknessToMagicka;
for (int i = WeaknessToFire; i <= WeaknessToNormalWeapons; ++i)
effects[i] = WeaknessToMagicka;
effects[Burden] = WeaknessToMagicka;
effects[Charm] = WeaknessToMagicka;

Loading…
Cancel
Save