When the turret AI is set to "Selected Target" mode of fire, it will fire at any selected target with no regard to range.
To reproduce:
1) Place a simple turret on a mothership entity.
2) Make sure the turret contains the following blocks:
- Bobby AI;
- Weapon computer;
- Weapon module.
3) Enable bobby with the following settings:
- Type: Turret;
- Active: Yes;
- Aim At: Selected Target.
4) Enter mothership core.
5) Select any far-away target.
Below are the example screenshots with different weapons:
Default beam range is 1000 meters. Range to target is 5000+ meters, beam fires.
{F981}
Default cannon range is 2000 meters. Target is clearly out of range.
{F983}