I recently ran into a “divide by zero” error in Function 1516 that was being caused by empty ground formation elements trying to be reinforced.
This came about (I believe) after the following:
-
I ticked the “Build Replacements” box at a colony with GFCCs and an empty GF training queue.
-
At the next con cycle, some formations had empty elements created as placeholders for needed replacements.
I’m not sure if the errors started at this point. It seems unlikely, because I have seen empty elements awaiting replacement at other colonies, so it seems that there is some recognition in place in the fortification logic to deal with empty elements that are waiting for a replacement to be built.
The errors may have started later, after I cleared the Replacement Template for an existing formation that had an empty element. (Because I wanted the colony to stop building replacements for this formation.)
Perhaps the fortification logic ignores empty elements unless the parent formation has no replacement template defined?