mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 13:23:53 +00:00
Don't clear spells for a dead player, preventing resurrection problems
This commit is contained in:
parent
88a7ecc18d
commit
411b6dcd8e
1 changed files with 6 additions and 2 deletions
|
@ -1865,13 +1865,17 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
else if (killResult == CharacterController::Result_DeathAnimJustFinished)
|
else if (killResult == CharacterController::Result_DeathAnimJustFinished)
|
||||||
{
|
{
|
||||||
|
bool isPlayer = iter->first == getPlayer();
|
||||||
notifyDied(iter->first);
|
notifyDied(iter->first);
|
||||||
|
|
||||||
// Reset magic effects and recalculate derived effects
|
// Reset magic effects and recalculate derived effects
|
||||||
// One case where we need this is to make sure bound items are removed upon death
|
// One case where we need this is to make sure bound items are removed upon death
|
||||||
stats.modifyMagicEffects(MWMechanics::MagicEffects());
|
stats.modifyMagicEffects(MWMechanics::MagicEffects());
|
||||||
stats.getActiveSpells().clear();
|
stats.getActiveSpells().clear();
|
||||||
|
|
||||||
|
if (!isPlayer)
|
||||||
stats.getSpells().clear();
|
stats.getSpells().clear();
|
||||||
|
|
||||||
// Make sure spell effects are removed
|
// Make sure spell effects are removed
|
||||||
purgeSpellEffects(stats.getActorId());
|
purgeSpellEffects(stats.getActorId());
|
||||||
|
|
||||||
|
@ -1880,7 +1884,7 @@ namespace MWMechanics
|
||||||
if (iter->first.getClass().isNpc())
|
if (iter->first.getClass().isNpc())
|
||||||
calculateNpcStatModifiers(iter->first, 0);
|
calculateNpcStatModifiers(iter->first, 0);
|
||||||
|
|
||||||
if( iter->first == getPlayer())
|
if (isPlayer)
|
||||||
{
|
{
|
||||||
//player's death animation is over
|
//player's death animation is over
|
||||||
MWBase::Environment::get().getStateManager()->askLoadRecent();
|
MWBase::Environment::get().getStateManager()->askLoadRecent();
|
||||||
|
|
Loading…
Reference in a new issue