apart from the fact that max_angle should be maxAngle, what is this test actually for? It prevents shooting if the angle between shiporientation and direction to target < 45°? What sense does that make?