summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin <julien.voisin@dustri.org>2021-12-29 12:34:12 +0000
committerjvoisin <julien.voisin@dustri.org>2021-12-29 12:34:12 +0000
commit23e279c23eb752c311db28a019fc4030b8f5e80a (patch)
treef8a02ef479e4a2bd094438ccecaf89ec10a1da93
parentcfa3c4f4a3f7d6596595c682e16baf1d55505194 (diff)
parent6f870a464be4a3b77706efcf0951510ca05c015e (diff)
Merge branch 'darling_violetta' into 'master'
Replace magic numbers with enums Closes #6523 See merge request OpenMW/openmw!1512
-rw-r--r--CHANGELOG.md1
-rw-r--r--components/esm/loadmgef.cpp28
2 files changed, 13 insertions, 16 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d239717d0a..02d86f8802 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/components/esm/loadmgef.cpp b/components/esm/loadmgef.cpp
index badbbb2133..7aff249aeb 100644
--- a/components/esm/loadmgef.cpp
+++ b/components/esm/loadmgef.cpp
@@ -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;