I was looking at pictures like this one and I was wondering how ships like these were able to fire their guns at targets that were not broadside to them. It would appear to me that there is so much flame and explosion that they would risk damage to themselves, especial their wooden decks. The game World of Warships even goes are far as putting anti-air guns directly in front of the primary armaments in their in game model. I guess my question is, "has there ever been a case where a ship has harmed itself or its crew members by firing its weapons?"
The damage from the ship's own guns to which you refer is called blast damage, and was a pretty common occurrence aboard battleships, and indeed any ship with large-calibre guns. It was always a major concern, from the very earliest days of battleship design. Things like boats, funnels, and masts are particularly vulnerable to this damage, and so their placement relative to the turrets must be considered thoroughly. This can limit turret placement, or increase the length of the ship to fit these vital functions. On older British ships, it also limited the turrets themselves. They used sighting hoods on the roof, which meant that superfiring pairs (where one turret fires over the top of another) couldn't be fired within 30^o of the centreline, as otherwise the blast would travel through the sighting hood of the lower turret and render it uninhabitable. To minimise the risk of injuries to the crew, it was common for AA guns placed near the turrets to be unmanned when the main guns were likely to be fired.
The British battleships Nelson and Rodney were particularly vulnerable to blast damage. They had a compact turret arrangement which had to fire close to the bridge when firing at targets behind the middle of the ship. They were also rather lightly built, due to treaty restrictions. This meant that blast had a major effect. During a test of Rodney's turrets at low elevations, a team of constructors who were a deck below the turrets, but in line with the muzzles, reported seeing a bright red flash when the guns were fired. Medical examination found that this was due to the effects of the concussion on their eyeballs. During Rodney's biggest battle, against the Bismarck, she did more damage to herself with blast than Bismarck did. Her upper deck was badly distorted, with planking ripped away, and fittings like AA guns dislodged. Below decks, pillars and girders were damaged. There was also damage to sensitive optics in the forward turret from the fire of the turret behind. It was easier to repair this damage and to live with the chance of it happening, than to limit your tactical options and lose battles as a result.