I found the problem. I added this code to allow the bofors gun to pan and tilt smoothly with the camera when firing. I don't know yet why but at least I know where.

Code:
while (mouse_left == off)
		{
		vec_set (weapon_offset.x, vector (120, 5, -35));
		vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt,0)); 
		vec_add (weapon_offset.x, camera.x);
		vec_set (my.x, weapon_offset.x);
		my.pan -= 8 * mouse_force.x * time_step;   
		my.tilt += 8 * mouse_force.y * time_step;
		my.tilt = clamp(my.tilt, -25, 85);
		wait (1);
		}
		while (joy_1 == off)
		{
		vec_set (weapon_offset.x, vector (120, 5, -35));
		vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt,0)); 
		vec_add (weapon_offset.x, camera.x);
		vec_set (my.x, weapon_offset.x);
		my.pan -= 2 * joy_force.x * time_step;   
		my.tilt += 2 * joy_force.y * time_step;
		my.tilt = clamp(my.tilt, -25, 85);
		wait (1);
		}