These are 2 bugs both related to shipyards:
The function number: #2097
The complete error text: 1.9.4. Attempted to divide by zero
The window affected: Main Window, but also Economy/shipyards
What you were doing at the time: I have two classes (Defiant class and Defiant Mk2 class) that for some strange reason have a refit cost of 0. This is the cause of the bug. When I tried to refit a Defiant class to Defiant 2, it threw the above mentioned error and deleted the shipyard tasks list. Now my save is corrupted (I get an error every construction phase) and I need to go back to a backup. Lesson: Don't try stupid things without saving first.
Conventional or TN start: C
Random or Real Stars: Real
Is your decimal separator a comma?: No
Is the bug is easy to reproduce, intermittent or a one-off?: unknown, I never had 2 classes with a refit cost of zero before. I have not tried to reproduce, but the class designs are in the DB.
If this is a long campaign - say 75 years or longer - let me know the length of the campaign as well: 47 years
Additional Info: The only difference between Defiant and Defiant 2 are the 2 upgraded Gauss turrets, 1 upgraded Beam fire control and some fighter fuel storage to bring the tonnage in line. I noticed after the bug happened that they do have the exact same number of build points. This might be why they have a refit cost of zero. Even if the build points are exactly the same, the refit and retool cost should not be zero, as it still takes work to upgrade those components. Also, I'm not even sure why the build points are the same, as the new Fire control costs almost twice as much as the old one.
An additional weird bug: I have some other cruiser variants, namely the Intrepid Strike Cruiser and the Ajax Command Cruiser. A shipyard tooled for the Defiant can build the Ajax and the Intrepid as their build points were apparently similar. All these classes have 2 Gauss turrets and 1 beam fire control for the turrets. I designed a Ajax 2 and Intrepid 2 with the same exact upgrades as the Defiant class (only change gauss turrets, Beam FC, fighter fuel storage). Now, the shipyard tooled for the Defiant 2 class cannot build Intrepid 2 or Ajax 2 classes, but they can build Ajax 1 and Intrepid 1 classes , even though the components difference between Defiant 2 and Ajax 2 is smaller than between Defiant 2 and Ajax 1. This is very confusing, but might be related to the first bug.
DB is attached, game is Cosinusgame