Normal attacks basically target the closest unit with an attack skill, or if none exist, the leftmost in-range enemy unit (with no attack skill of course). The target is chosen in the function attackableOnRange in source/glest_game/world/unit_updater.cpp.
The attack_stopped skill (hold_position, towers), however, only attacks the leftmost unit, regardless of whether it has an attack skill. This often results in a single unit drawing fire from all towers that can fire at it, often resulting in a waste of shots. Also, it causes tower performance to vary depending on the direction of the attack--players attacking from the left will have their ranged units attacked first by towers.
This is because the function updateAttackStopped finds its target using unitBeingAttacked, which just gives the leftmost unit. It also has a use of attackableOnRange like the normal attack does, but only if unitBeingAttacked fails, and I don't think that branch is ever followed when there is actually anything to attack.
Thus, applying [url=http://pastebin.com/imfv9kcK]this diff[/url]
results in the same behavior for attack_stopped as normal attack.
[url=http://s000.tinyupload.com/index.php?file_id=05647447169642467245]This scenario[/url]
may demonstrate the inefficiency of the leftmost-first targeting in the case of anti-air towers. Leftmost-first targeting also means that towers with reduced range (e.g. 12 instead of 15) can be more effective than those with greater range, since they will have different targets and thus waste fewer shots.
Leftmost-first doesn't matter as much when there are only units that can't attack, since players are usually in the "destroy the helpless base" stage of the game when that happens.