For each object that is within X distance to turret, fire a "check bullet" at it to check if it can see the object, if it can, turn the gun to face the object and start firing real bullets at it.
Sadly, families could take some of the blame, they're alot better than they were, but still buggy sometimes.