|
|
|
@ -208,10 +208,15 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool hasDuration = !(magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration);
|
|
|
|
|
if (hasDuration && effectIt->mDuration == 0)
|
|
|
|
|
effect.mDuration = hasDuration ? static_cast<float>(effectIt->mDuration) : 1.f;
|
|
|
|
|
|
|
|
|
|
bool appliedOnce = magicEffect->mData.mFlags & ESM::MagicEffect::AppliedOnce;
|
|
|
|
|
if (!appliedOnce)
|
|
|
|
|
effect.mDuration = std::max(1.f, effect.mDuration);
|
|
|
|
|
|
|
|
|
|
if (effect.mDuration == 0)
|
|
|
|
|
{
|
|
|
|
|
// We still should add effect to list to allow GetSpellEffects to detect this spell
|
|
|
|
|
effect.mDuration = 0.f;
|
|
|
|
|
appliedLastingEffects.push_back(effect);
|
|
|
|
|
|
|
|
|
|
// duration 0 means apply full magnitude instantly
|
|
|
|
@ -224,8 +229,6 @@ namespace MWMechanics
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
effect.mDuration = hasDuration ? static_cast<float>(effectIt->mDuration) : 1.f;
|
|
|
|
|
|
|
|
|
|
effect.mTimeLeft = effect.mDuration;
|
|
|
|
|
|
|
|
|
|
targetEffects.add(MWMechanics::EffectKey(*effectIt), MWMechanics::EffectParam(effect.mMagnitude));
|
|
|
|
|