mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 03:15:34 +00:00
Rebuild actor animations on resurrection (Fixes #3124)
A new animation is necessary to set up the correct InventoryStore listener, to get notified of changes like the actor no longer being a werewolf, etc.
This commit is contained in:
parent
daa94cc50e
commit
e6619c5306
1 changed files with 7 additions and 1 deletions
|
@ -1125,10 +1125,16 @@ namespace MWScript
|
|||
ptr.getClass().getCreatureStats(ptr).resurrect();
|
||||
else if (ptr.getClass().getCreatureStats(ptr).isDead())
|
||||
{
|
||||
bool wasEnabled = ptr.getRefData().isEnabled();
|
||||
MWBase::Environment::get().getWorld()->undeleteObject(ptr);
|
||||
// resets runtime state such as inventory, stats and AI. does not reset position in the world
|
||||
MWBase::Environment::get().getWorld()->removeContainerScripts(ptr);
|
||||
|
||||
// HACK: disable/enable object to re-add it to the scene properly (need a new Animation).
|
||||
MWBase::Environment::get().getWorld()->disable(ptr);
|
||||
// resets runtime state such as inventory, stats and AI. does not reset position in the world
|
||||
ptr.getRefData().setCustomData(NULL);
|
||||
if (wasEnabled)
|
||||
MWBase::Environment::get().getWorld()->enable(ptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue