This patch allows subunits to be specified in the template. Subunits can be ordinary entities with UnitAI (so can be individually ordered), which are visibly garrisoned on the parent.
If the parent has UnitAI and an order (to attack) is given to it, the order is automatically delegated once in range. This means the subunit will attack anything in range until it gets in range of the intended target, after which it will start attacking that target.
There is also a `forced`-option in the template, to disallow ungarrisoning (or deleting) the subunit (and allow entities which are normally not allowed to visibly garrison, which might be useful for scripted maps (e.g. spearmen holding guard on a wall)).
There are a few changes that can be split in seperate diffs if deemed necessary.
- Unified `GetRange`-calls: depends on D2328.
- `IsUnloadable` is a candidate for D1960 I guess?
---
ToDo for this patch:
- (De)serialising, suspected to fail because of the turrets of a garrison holder not being (de)serialised in CCmpPosition.
- JSDOC.
Possible extensions:
- Increased spread (when moving)?
- Riding stances.
- CanAttackFromAngle with an MaxAttackAngle.