mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-09 21:44:54 +00:00
Set magic effects that don't support variable durations to use duration of 1
This commit is contained in:
parent
1c2e04747d
commit
610f36f47b
@ -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…
x
Reference in New Issue
Block a user