As discussed today on IRC.
The 'defensive' stance is problematic because it combines attributes of a stance and an order.
it would be simpler to not have a notion of "held ground" depend on the defensive stance, but rather to rely on existing orders, such as Guard or Patrol, for this. This makes Defensive less weird as a stance, while still keeping all of the functionality.
Note that this is a bug fix. Currently, the held position is only reset when Order.Walk & friends are processed, which is usually on player order but sometimes self-given by the AI, making the behaviour unpredictable and broken. Units can end up far from the held position, which ends with them no longer correctly responding to entities in sight.
Introduces a custom cleanup for orders, which doesn't really exist right now, but we should probably move most of the "order-temporaries", such as the "hunting", "secondTry" and such variables here.
This is still WIP, it works but there are unaccounted for edge cases and i don't believe formations behave properly.