[Bug] Turret definitions cause critical errors

Under [turrets] in the race file, if there isn’t a definition for every weapon module which has a “turret_sprite” entry, the game crashes in the ship designer.

This is mostly a problem with mods and official updates that change/add modules. What I foresee happening is someone installs a turret or race mod that crashes the game because the built-in race files aren’t updated properly.

Example:

  1. Open one of the races, say Alliance, and delete the “tractor_turret_v2” turret entry.
  2. Go to the in-game ship builder, and select an alliance cruiser hull.
  3. Clicking the “Other” or “All” tabs, where the improved tractor beam should show up, results in a crash.

The ideal fix for this would be for the game to lock races out of weapons that it doesn’t have turret definitions for. The easier fix is probably to use a default “error texture” if there isn’t one specified. Maybe a hot pink blob so it’s obvious the graphic isn’t working right?