Some years ago was done a temporary solution http://trac.wildfiregames.com/ticket/818#comment:5 giving BuildingAI to units with UnitAI.
Meanwhile BuildingAI has been improved (see #2010).
But the hack leads to some issues #3763, rP17784, #4189, #4000 and prevent future developpement.
Following cleaning plan suggested by leper in https://wildfiregames.com/forum/index.php?/topic/21358-buildingai-unitai-attack-story-of-an-hack/ (staff only):
- Copy old BuildingAI in ManpowerHolderBuilding and ManpowerHolderUnit (names suggested by Itms). Both component implement the same interface ManpowerHolder.
- Remove some useless functions in ManpowerHolderBuilding (related to unitAI target).
- Let Units with ManpowerHolderUnit do their not ranged attack.
- Do the needed change for tooltips...
- So: no changes (regression) compared to the current implementation, but ManpowerHolderUnit is ready to be modified in the future.