Well, I was wrong about how close I was to having resupply reintegrated; I moved the global functions that did all the work into a scratch file, and finally merged them into five simpler functions with the actually functionality properly compartmentalized. I can probably now refine that down to 3 functions.
The actual resupply queue shouldn’t be so tricky now, but I’ll have to review my plan. As ever, there was a ton of duplicated and redundant functionality that was designed to make each layer capable of dealing with various conditions, but very little of which was really neccessary to the bigger picture – complexity begets complexity.
Its possible that before my previous sweeps, there was additional code in there that required this extra complexity to make things happen in the right order, but when you start writing OO code it just becomes cleaner.
I also ran into a problem with GCC on my build box *sigh*. I was able to solve it by tagging a whole bunch of function prototypes as “extern”. This does not bode well.