mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 19:36:39 +00:00
Take in account elemental shields for GetResist and SetResist script commands (bug #4093)
This commit is contained in:
parent
335ecd1162
commit
c6fd75bf42
1 changed files with 16 additions and 0 deletions
|
@ -1189,6 +1189,14 @@ namespace MWScript
|
||||||
if (mNegativeEffect != -1)
|
if (mNegativeEffect != -1)
|
||||||
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
||||||
|
|
||||||
|
// GetResist* should take in account elemental shields
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFire)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistShock)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFrost)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude();
|
||||||
|
|
||||||
int ret = static_cast<int>(currentValue);
|
int ret = static_cast<int>(currentValue);
|
||||||
runtime.push(ret);
|
runtime.push(ret);
|
||||||
}
|
}
|
||||||
|
@ -1215,6 +1223,14 @@ namespace MWScript
|
||||||
if (mNegativeEffect != -1)
|
if (mNegativeEffect != -1)
|
||||||
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
currentValue -= effects.get(mNegativeEffect).getMagnitude();
|
||||||
|
|
||||||
|
// SetResist* should take in account elemental shields
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFire)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FireShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistShock)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::LightningShield).getMagnitude();
|
||||||
|
if (mPositiveEffect == ESM::MagicEffect::ResistFrost)
|
||||||
|
currentValue += effects.get(ESM::MagicEffect::FrostShield).getMagnitude();
|
||||||
|
|
||||||
int arg = runtime[0].mInteger;
|
int arg = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
effects.modifyBase(mPositiveEffect, (arg - static_cast<int>(currentValue)));
|
effects.modifyBase(mPositiveEffect, (arg - static_cast<int>(currentValue)));
|
||||||
|
|
Loading…
Reference in a new issue