1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +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:
scrawl 2016-01-04 20:27:38 +01:00
parent daa94cc50e
commit e6619c5306

View File

@ -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);
}
}
};