Bug: flying deployable units

This is present in 1.7 and also in current git revision.

How to reproduce: order a deployable unit (MG, At gun, etc) to move and, while it’s moving, order a deploy directed backwards relative to where the moving unit is going. When morph starts, hit Stop. See the unit flying to the map border in the direction it was moving before morph.

Probable place in code: StopMorph() in unit_morph.lua calls Spring.MoveCtrl.Disable(unitID). I tried setting unit velocity to 0 before that line with no luck, so far out of ideas.

Try enabling movectrl?

Movectrl gets disabled on morph cancel, how else the unit would be able to move? (Or maybe I don’t understand what I’m saying)

Fixed by giving the unit a move order to it’s current position right after disabling MoveCtrl.