When giving individual-orders to units in formation (gather, attack), there is an odd bug: if the target moves away too much, the entities suddenly reform at the original formation centre, then carry on with their order.
Fix: ShapeUpdate, called every second, should check for this.rearrange, which is correctly set in UnitAI.
A side-effect of this bug is that the formation-controller has a Position, which doesn't make sense while its members are carrying out individual tasks. So we should move it out the world while in "MEMBER" states, to prevent confusion and errors (afaik this doesn't actually fix any bug, but who knows).
This forces me to revert the bit in rP22506 that made IDLE formation units go back to their offset (since there may be no offset). Further, that commit introduced redundant state with formations, and issues (such as an infinite loop fixed in rP23217). This is all gone.
Instead, when the formation MEMBER state is done, if it has no following orders, it will reform explicitly, moving back into the world and moving entities back into formation. This seems OK enough to me.
This fixes Individual orders (gather, attack, return resource, construct...) for formations.
rP23346 fixed units not facing correctly after a formation-walk. The fix is correct, but we can actually make it slightly more self-contained by moving everything in leave. Also clarify comments.
This fixes some very broken code in rP22447 in FORMATIONMEMBER.WALKING.MovementUpdate. It never errored because formation controllers weren't moved out of the world before.
Reported by Angen & Freagarach at #5443