Switch to the running animation only above a certain ratio of the walk speed.
Following D3221/38c3827d3b, units switch to the 'run' animation when moving faster than their walkspeed. This makes formations 'flickery' because units often move slightly faster than their walkspeed when the formation rotate slightly, which happens often. It looks fairly bad. This switches to the running animation halfway through, though a more general system would be more desirable. Approved By: Angen Reviewed By: bb Differential Revision: https://code.wildfiregames.com/D3224 This was SVN commit r24456.
This commit is contained in:
parent
1e8299dcdb
commit
d7caa91420
@ -1068,11 +1068,11 @@ void CCmpUnitMotion::UpdateMovementState(entity_pos_t speed)
|
||||
if (cmpObstruction)
|
||||
cmpObstruction->SetMovingFlag(true);
|
||||
if (cmpVisual)
|
||||
cmpVisual->SelectMovementAnimation(speed > m_WalkSpeed ? "run" : "walk", speed);
|
||||
cmpVisual->SelectMovementAnimation(speed > (m_WalkSpeed / 2).Multiply(m_RunMultiplier + fixed::FromInt(1)) ? "run" : "walk", speed);
|
||||
}
|
||||
// Speed change, update the visual actor if necessary.
|
||||
else if (speed != m_CurSpeed && cmpVisual)
|
||||
cmpVisual->SelectMovementAnimation(speed > m_WalkSpeed ? "run" : "walk", speed);
|
||||
cmpVisual->SelectMovementAnimation(speed > (m_WalkSpeed / 2).Multiply(m_RunMultiplier + fixed::FromInt(1)) ? "run" : "walk", speed);
|
||||
|
||||
m_CurSpeed = speed;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user