OpenXcom Forum

Contributions => Programming => Topic started by: Phezzan on July 03, 2013, 07:46:45 pm

Title: FIX: Mod items without listOrder are considered live aliens by TransferItemsStat
Post by: Phezzan on July 03, 2013, 07:46:45 pm
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
Title: Re: FIX: Mod items without listOrder are considered live aliens by TransferItemsStat
Post by: Warboy1982 on July 08, 2013, 10:59:41 pm
nice catch, thanks, added to master.