forked from teamnwah/openmw-tes3coop
Disable actor collision only after end of death animation
This commit is contained in:
parent
ebaa6fb5a2
commit
b0a140e714
3 changed files with 4 additions and 1 deletions
|
@ -31,7 +31,7 @@ namespace MWClass
|
|||
if (!model.empty())
|
||||
{
|
||||
physics.addActor(ptr, model);
|
||||
if (getCreatureStats(ptr).isDead())
|
||||
if (getCreatureStats(ptr).isDead() && getCreatureStats(ptr).isDeathAnimationFinished())
|
||||
MWBase::Environment::get().getWorld()->enableActorCollision(ptr, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,6 +135,7 @@ namespace MWClass
|
|||
data->mCreatureStats.setAiSetting (MWMechanics::CreatureStats::AI_Flee, ref->mBase->mAiData.mFlee);
|
||||
data->mCreatureStats.setAiSetting (MWMechanics::CreatureStats::AI_Alarm, ref->mBase->mAiData.mAlarm);
|
||||
|
||||
// Persistent actors with 0 health do not play death animation
|
||||
if (data->mCreatureStats.isDead())
|
||||
data->mCreatureStats.setDeathAnimationFinished(ptr.getClass().isPersistent(ptr));
|
||||
|
||||
|
|
|
@ -352,6 +352,8 @@ namespace MWClass
|
|||
|
||||
data->mNpcStats.setNeedRecalcDynamicStats(true);
|
||||
}
|
||||
|
||||
// Persistent actors with 0 health do not play death animation
|
||||
if (data->mNpcStats.isDead())
|
||||
data->mNpcStats.setDeathAnimationFinished(ptr.getClass().isPersistent(ptr));
|
||||
|
||||
|
|
Loading…
Reference in a new issue