Fixed a bug that could cause corpses to "wiggle" if a unit died while moving.
This was SVN commit r4532.
This commit is contained in:
parent
4fb0f2ae5d
commit
4730ed0276
@ -246,7 +246,6 @@ void CEntity::kill()
|
||||
|
||||
updateCollisionPatch();
|
||||
|
||||
|
||||
me = HEntity(); // will deallocate the entity, assuming nobody else has a reference to it
|
||||
}
|
||||
|
||||
|
@ -390,6 +390,15 @@ bool CEntity::Kill( JSContext* UNUSED(cx), uintN UNUSED(argc), jsval* UNUSED(arg
|
||||
|
||||
if( m_actor && m_actor->GetRandomAnimation( "death" ) != m_actor->GetRandomAnimation( "idle" ) )
|
||||
{
|
||||
// Prevent "wiggling" as we try to interpolate between here and our death position (if we were moving)
|
||||
m_graphics_position = m_position;
|
||||
m_position_previous = m_position;
|
||||
m_graphics_orientation = m_orientation;
|
||||
m_orientation_previous = m_orientation;
|
||||
updateActorTransforms();
|
||||
|
||||
// Play death animation and keep the actor in the game in a dead state
|
||||
// (TODO: remove the actor after some time through some kind of fading mechanism)
|
||||
m_actor->SetEntitySelection( "death" );
|
||||
m_actor->SetRandomAnimation( "death", true );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user