mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Make Resurrect function reset most of the runtime state (Fixes #2181)
This commit is contained in:
parent
41542dedf7
commit
2952a0e2aa
1 changed files with 8 additions and 1 deletions
|
@ -1179,7 +1179,14 @@ namespace MWScript
|
|||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
MWWorld::Ptr ptr = R()(runtime);
|
||||
|
||||
if (ptr == MWBase::Environment::get().getWorld()->getPlayerPtr())
|
||||
ptr.getClass().getCreatureStats(ptr).resurrect();
|
||||
else if (ptr.getClass().getCreatureStats(ptr).isDead())
|
||||
{
|
||||
// resets runtime state such as inventory, stats and AI. does not reset position in the world
|
||||
ptr.getRefData().setCustomData(NULL);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue