Skip to main content
natural_criticB837
Legend
November 14, 2013
Question

Code Translation Bug in iOS release build

  • November 14, 2013
  • 1 reply
  • 874 views

Hello,

I think I found a bug in the Adobe compiler to build an iOS ipa. It only happens on ipa release builds, not interpreter builds and I have tried it with several Adobe Air SDKs (from 3.6 to 3.9).

This function:

protected function isCardValid(player:Player, card:Card):Boolean

        {

            if (trick.length == 0) return true;

            else if (cardsMatch(trick[0], card)) return true;

           

            var validCardLeft:Boolean = false;

            for (var i:uint = 0; i < player.hand.cards.length; ++i)

                if (cardsMatch(trick[0], player.hand.cards))

                {

                    validCardLeft = true;

                    break;

                }

           

            return !validCardLeft;

        }

Will return true on ipa-app-store, no matter the value of validCardLeft. I have verified with popups, that the value of validCardLeft contains the correct value, nevertheless the function always returns true. It happened in 2 of my games, that use this function but a different implementation for cardsMatch();

Using the ugly

if (validCardLeft) return false;

else return true;

fixes the problem.

This topic has been closed for replies.

1 reply

Participating Frequently
April 1, 2014

Ran into a similar issue on AIR 4.0 while using "-swf-version=21" as an additional compiler option.

Assigning a boolean variable the value "false" and checking it in an if statement always evaluates as "true" on iOS ad hoc builds.

Changing the if statement to check "true" instead and using an else to handle the appropriate logic seems to have fixed the issue.