Issues with [source path] FlashPunk-1.7.2

(Beats Promotions) #1

Issues with [source path] FlashPunk-1.7.2, I have a yellow alert symbol next to the folder name with triangle with this !, when I drill on the net folder it show the yellow triangle symbol with !, I drill down the flashpunk package and the, files show the same thing

in the file in this line it’s a yellow alert triangle w symbol ! if ((e = collideTypes(solidType, this.x + sign, this.y))) if ((e = collideTypes(solidType, this.x, this.y + sign))) if ((e = collide(type, x, y))) return e;

in the file is show a red circle with a x in this line of code if (_mask.collide(FP.entity.HITBOX))

            if (_mask.collide(FP.entity.HITBOX))

In the file I have this error too
if ((e = collidePoint(type, x, y)))

(Bora Kasap) #2

actually, i would suggest you firstly, use “==” instead of “=”

(Jacob Albano) #3

It seems that the intention is to assign e inside the conditional; = is appropriate for this purpose.

(Zachary Lewis) #4

@Beats_Promotions Are you using Actionscript Compiler 2.0? This would cause this warning. I’d recommend using the legacy Actionscript Compiler. What IDE are you using?

@AlobarNon This isn’t his code. It’s FlashPunk source.

@jacobalbano Sadly, it’s fallen out of favor, and they are working on deprecating it. I can see both sides of the argument, but I’m actually not too sad to see it go. The advantages of an in-conditional assignment usually isn’t worth the debugging or maintaining headaches that come with it.

From ActionScript Compiler 2.0 Backward Compatibility:

  • Behavior change: Warn on assignment in any conditional expression
  • Behavior in legacy compiler: The legacy compiler only warns for assignment as an immediate child of an if.
  • Behavior in ASC 2.0: A warning appears if an assignment is used (alone or via Boolean operations) as part of a conditional expression. However, no warning appears if an assignment is part of an arithmetic or comparison expression.
  • Severity of change: Stricter

We can fix this issue by evaluating the entire assignment.

if ( (e = collidePoint(type, x, y) ) != null )

Not sure about the error on the collision conditional.

(Jacob Albano) #5

I don’t use in-conditional assignment myself, but @alobarnon’s suggestion would have just broken the original code so I wanted to point that out. :wink: