They wont blow up due to their own gunfire but by being hit by other ships
The AI is dumb in that it only sees you and not whats inbetween
So vessels from behind say the Tirpitz will fire at you but hit it instead
No way to change that
I guess not opening fire in your own port at your own shipping would go a long way to solving it