mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-25 07:08:24 +00:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user