forked from mirror/openmw-tes3mp
Set magic effects that don't support variable durations to use duration of 1
This commit is contained in:
parent
1c2e04747d
commit
610f36f47b
1 changed files with 6 additions and 2 deletions
|
@ -463,7 +463,8 @@ namespace MWMechanics
|
|||
}
|
||||
else // target.getClass().isActor() == true
|
||||
{
|
||||
if (effectIt->mDuration == 0)
|
||||
bool hasDuration = !(magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration);
|
||||
if (hasDuration && effectIt->mDuration == 0)
|
||||
{
|
||||
// duration 0 means apply full magnitude instantly
|
||||
bool wasDead = target.getClass().getCreatureStats(target).isDead();
|
||||
|
@ -479,7 +480,10 @@ namespace MWMechanics
|
|||
ActiveSpells::ActiveEffect effect;
|
||||
effect.mEffectId = effectIt->mEffectID;
|
||||
effect.mArg = MWMechanics::EffectKey(*effectIt).mArg;
|
||||
effect.mDuration = static_cast<float>(effectIt->mDuration);
|
||||
if (!hasDuration)
|
||||
effect.mDuration = 1.0f;
|
||||
else
|
||||
effect.mDuration = static_cast<float>(effectIt->mDuration);
|
||||
effect.mMagnitude = magnitude;
|
||||
|
||||
targetEffects.add(MWMechanics::EffectKey(*effectIt), MWMechanics::EffectParam(effect.mMagnitude));
|
||||
|
|
Loading…
Reference in a new issue