mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Merge pull request #2884 from Capostrophic/deathmagic
Update spell effects during death animation (#5403)
This commit is contained in:
commit
dd7f5fcde7
4 changed files with 18 additions and 6 deletions
|
@ -17,6 +17,7 @@
|
|||
Bug #5370: Opening an unlocked but trapped door uses the key
|
||||
Bug #5397: NPC greeting does not reset if you leave + reenter area
|
||||
Bug #5400: Editor: Verifier checks race of non-skin bodyparts
|
||||
Bug #5403: Enchantment effect doesn't show on an enemy during death animation
|
||||
Bug #5415: Environment maps in ebony cuirass and HiRez Armors Indoril cuirass don't work
|
||||
Bug #5416: Junk non-node records before the root node are not handled gracefully
|
||||
Bug #5424: Creatures do not headtrack player
|
||||
|
|
|
@ -1720,9 +1720,14 @@ namespace MWMechanics
|
|||
|
||||
iter->first.getClass().getCreatureStats(iter->first).getActiveSpells().update(duration);
|
||||
|
||||
// For dead actors we need to remove looping spell particles
|
||||
// For dead actors we need to update looping spell particles
|
||||
if (iter->first.getClass().getCreatureStats(iter->first).isDead())
|
||||
{
|
||||
// They can be added during the death animation
|
||||
if (!iter->first.getClass().getCreatureStats(iter->first).isDeathAnimationFinished())
|
||||
adjustMagicEffects(iter->first);
|
||||
ctrl->updateContinuousVfx();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool cellChanged = world->hasCellChanged();
|
||||
|
|
|
@ -60,8 +60,13 @@ namespace MWMechanics
|
|||
void CastSpell::inflict(const MWWorld::Ptr &target, const MWWorld::Ptr &caster,
|
||||
const ESM::EffectList &effects, ESM::RangeType range, bool reflected, bool exploded)
|
||||
{
|
||||
if (!target.isEmpty() && target.getClass().isActor() && target.getClass().getCreatureStats(target).isDead())
|
||||
if (!target.isEmpty() && target.getClass().isActor())
|
||||
{
|
||||
// Early-out for characters that have departed.
|
||||
const auto& stats = target.getClass().getCreatureStats(target);
|
||||
if (stats.isDead() && stats.isDeathAnimationFinished())
|
||||
return;
|
||||
}
|
||||
|
||||
// If none of the effects need to apply, we can early-out
|
||||
bool found = false;
|
||||
|
@ -201,9 +206,9 @@ namespace MWMechanics
|
|||
}
|
||||
|
||||
bool effectAffectsHealth = isHarmful || effectIt->mEffectID == ESM::MagicEffect::RestoreHealth;
|
||||
if (castByPlayer && target != caster && effectAffectsHealth)
|
||||
if (castByPlayer && target != caster && !target.getClass().getCreatureStats(target).isDead() && effectAffectsHealth)
|
||||
{
|
||||
// If player is attempting to cast a harmful spell or is healing someone, show the target's HP bar.
|
||||
// If player is attempting to cast a harmful spell on or is healing a living target, show the target's HP bar.
|
||||
MWBase::Environment::get().getWindowManager()->setEnemy(target);
|
||||
}
|
||||
|
||||
|
|
|
@ -572,7 +572,8 @@ void MWWorld::InventoryStore::updateMagicEffects(const Ptr& actor)
|
|||
|
||||
mMagicEffects = MWMechanics::MagicEffects();
|
||||
|
||||
if (actor.getClass().getCreatureStats(actor).isDead())
|
||||
const auto& stats = actor.getClass().getCreatureStats(actor);
|
||||
if (stats.isDead() && stats.isDeathAnimationFinished())
|
||||
return;
|
||||
|
||||
for (TSlots::const_iterator iter (mSlots.begin()); iter!=mSlots.end(); ++iter)
|
||||
|
|
Loading…
Reference in a new issue