mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-21 03:44:05 +00:00
Fix for instant restore effects (Fixes #2392)
This commit is contained in:
parent
68f89318e7
commit
77bb77b367
1 changed files with 2 additions and 1 deletions
|
@ -594,6 +594,7 @@ namespace MWMechanics
|
||||||
value.restore(magnitude);
|
value.restore(magnitude);
|
||||||
target.getClass().getCreatureStats(target).setAttribute(attribute, value);
|
target.getClass().getCreatureStats(target).setAttribute(attribute, value);
|
||||||
}
|
}
|
||||||
|
// TODO: refactor the effect tick functions in Actors so they can be reused here
|
||||||
else if (effectId == ESM::MagicEffect::DamageHealth)
|
else if (effectId == ESM::MagicEffect::DamageHealth)
|
||||||
{
|
{
|
||||||
applyDynamicStatsEffect(0, target, magnitude * -1);
|
applyDynamicStatsEffect(0, target, magnitude * -1);
|
||||||
|
@ -683,7 +684,7 @@ namespace MWMechanics
|
||||||
void CastSpell::applyDynamicStatsEffect(int attribute, const MWWorld::Ptr& target, float magnitude)
|
void CastSpell::applyDynamicStatsEffect(int attribute, const MWWorld::Ptr& target, float magnitude)
|
||||||
{
|
{
|
||||||
DynamicStat<float> value = target.getClass().getCreatureStats(target).getDynamic(attribute);
|
DynamicStat<float> value = target.getClass().getCreatureStats(target).getDynamic(attribute);
|
||||||
value.modify(magnitude);
|
value.setCurrent(value.getCurrent()+magnitude, attribute == 2);
|
||||||
target.getClass().getCreatureStats(target).setDynamic(attribute, value);
|
target.getClass().getCreatureStats(target).setDynamic(attribute, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue