Looks like svn revision 4517 brought a new problem to Spring. That change was to make units unable to fire at their target move sideways (so they may find a clean line of fire).
However, it doesn't take into account the reasons one unit cannot fire at the other. That's not always caused by blocked line of fire! For example, now units will orbit things they cannot shoot because of OnlyTargetCategory or script-blocked weapons.
My example: I have a unit with 2 weapons, an autocannon and a missile launcher. Missile launcher has a deploying animation (hatches opening, missile loading and such) that takes some time (3 seconds) during which it is jammed by AimWeapon2. Weapons are set up so that autocannon will only fire at light units and the missile will only target heavy units. Now if there is a heavy unit in range, my unit will start to go sideways until the missile deployment anim finishes (since both weapons are considered blocked during that time - OnlyTargetCategory prevents autocannon from firing at heavy things and the missile isn't ready to fire yet). That is not the intended behaviour, the unit can lose line of fire because of that.
This is probably not noticeable in TA-based mods (not many units with different OnlyTargetCategory per-weapon there), but it can affect other mods greatly.
Problem with OnlyTargetCategory and current svn Spring
Moderator: Moderators
I can't seem to recreate the problem with the script-blocked weapons. Additionally, I can't see how script blocked weapons could cause a problem. TryTarget(...) does not seem to have any calls to the scripts, and only checks if the weapon can hit the target, not if it can fire (unless it has no stockpile).
I do however, see the problem with the OnlyTargetCategory, and am writing code that fixes that now.
I do however, see the problem with the OnlyTargetCategory, and am writing code that fixes that now.
