What this bug affects:
Affected items cannot be transferred unless the receiving base has Alien Containment.
For me - I couldn't send a custom Tank.
Currently this source file determines what is 'alive' by checking the index against the number of items that were not live aliens during initialization.
Unfortunately it doesn't attempt to reorder items before any live aliens it already added.
(probably because a reordered list would desync the index with a string vector or something)
I wrote a couple little private functions to simplify determining which index is what type, and then asked the RuleItem itself everytime I needed to know.
It worked for me - hopefully I didn't miss anything.
Let me know if I screwed up the patch - alternatively I could learn how to make pull requests.
PS: I believe this change compiles clean with -Wall and -Wextra