HomeWildfire Games

Fix a rare case of unit 'gliding' while moving.

Description

Fix a rare case of unit 'gliding' while moving.

Fixes rP22446: if the speed doesn't change, UnitMotion doesn't update the visual actor. Unfortunately, if another component has in the meantime reset the animation to 'Idle', the unit will now move while Idle. This can happen when leaving formation to do something else, though it'srare.

This fixes that by instead always calling VisualActor, which does its own checking to avoid redundancy. It's a bit less efficient, but not too much.
Note that this relies on UnitMotion::UpdateMovementState being called after any UnitAI code that could reset the animation to IDLE.

Differential Revision: https://code.wildfiregames.com/D3619