HomeWildfire Games

ComputeMotionParameters correctly when formation member is added or removed

Description

ComputeMotionParameters correctly when formation member is added or removed

As noticed by @bb in https://code.wildfiregames.com/D1727?id=7276#inline-38148 and found issue in https://code.wildfiregames.com/rP11934#inline-4563 ComputeMotionParameters is not called correctly.

One problem is when merging twinformations, addMembers does not update speed, so if one formation contains slowest unit and it is merged to formation which does not, merged formation will move faster than it should, the same problem applies if unit is added calling function from outside of component.

Another problem is when from formation is removed slowest unit and has rearrange set to false. Having speed computation after rearrange check means formation is not going to move faster if slowest member is removed by player or killed (but it will if player recreates formation manually)

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