[212]loopindex has wrong scope on return from function

0 favourites
  • 3 posts
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • Problem Description

    Moving from 206 to 212, I am finding my loops are broken. I ran through all of the releases up to 212, and the issue appears only in 212, presumably a side effect of the other loopindex fix. When iterating a double loop of X & Y, and calling a function which also iterates using the same variables, even though the loop iterates the correct number of times, using loopindex() returns the last values that the function had, from the previous call.

    I suspect there may be other issues with this recent change, but this was the only case I could reproduce here.

    Attach a Capx

    Description of Capx

    Iterate in "x" and also "y" which calls a function that iterates the same names.

    Steps to Reproduce Bug

      Run and look in CONSOLE for debug statements.

    Observed Result

    The outer loop works once, but after that, the outer loop only reports (via loopindex()) the last values set within the function's loop.

    Expected Result

    The scoping of the loop names/variables should revert back to the scope of the outer call.

    Affected Browsers

    • N/A

    Operating System and Service Pack

    Win 8

    Construct 2 Version ID

    212

  • Gah. A supposedly trivial one-liner change that subtley broke things.

    There was another issue with the Video plugin so I've released r212.2 which should have fixed this now.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanx for this hotfix!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)