mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Don't tick effects when duration is zero
This commit is contained in:
parent
78a733a12c
commit
4af376133b
@ -486,14 +486,17 @@ namespace MWMechanics
|
|||||||
|
|
||||||
bool wasDead = creatureStats.isDead();
|
bool wasDead = creatureStats.isDead();
|
||||||
|
|
||||||
for (MagicEffects::Collection::const_iterator it = effects.begin(); it != effects.end(); ++it)
|
if (duration > 0)
|
||||||
{
|
{
|
||||||
// tickable effects (i.e. effects having a lasting impact after expiry)
|
for (MagicEffects::Collection::const_iterator it = effects.begin(); it != effects.end(); ++it)
|
||||||
effectTick(creatureStats, ptr, it->first, it->second.getMagnitude() * duration);
|
{
|
||||||
|
// tickable effects (i.e. effects having a lasting impact after expiry)
|
||||||
|
effectTick(creatureStats, ptr, it->first, it->second.getMagnitude() * duration);
|
||||||
|
|
||||||
// instant effects are already applied on spell impact in spellcasting.cpp, but may also come from permanent abilities
|
// instant effects are already applied on spell impact in spellcasting.cpp, but may also come from permanent abilities
|
||||||
CastSpell cast(ptr, ptr);
|
CastSpell cast(ptr, ptr);
|
||||||
cast.applyInstantEffect(ptr, ptr, it->first, it->second.getMagnitude());
|
cast.applyInstantEffect(ptr, ptr, it->first, it->second.getMagnitude());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user