Some hefty OnlyTargetableCategories issues

If you have for example a marder and give it a fight command it might not stop to shoot. This can be caused by a non targetable enemy being closer than a targetable unit.
If there is enemy infantry beetween the marder and the enemy tanks, the marder will drive towards its’ fight or patrol order and will drive trough the enemy infantry. It will not stop and face the enemy tanks until the tanks are closer than the infantry.
Neutral or enemy flags cause big troubles to turretless vehicles, most infantry and units without “turrets” as they might not engage the enemy even if they are set on Roam or Manouver.
The same might apply in other mods when you are sending in fighters(AA only) over enemy ground units. Will they only chase enemy air units if the enemy air units are closer than the untargetable ground units? Are “closest” determined by 2D or 3D coordinates?

There was also an issue with the nochasecategories of some of these units, so they should be slightly better now, but the real problem is yet to be addressed:

The problem is with the engine returning neutral or untargetable units in GetClosestEnemy, Tobi is looking into an engine side fix. I’ve been thinking about how to make a hack around in lua, but I’m not sure it’s feasible. We may simply have to wait.

This is fixed in the engine now. (Link)