Support `true` and `false` as valid comparison values for `var` operator
Title.
I created a new macro and added its case to AutoVar, and then used it in my pory script. But it gave me an error because of == true.
- if(islevelcapactive == true) {
+ if(islevelcapactive) {
setvar(B_LEVEL_CAP_VARIABLE, 17)
}
Error if used == true:
data/maps/CastbellePath/scripts.pory: Assembler messages:
data/maps/CastbellePath/scripts.pory:246: Error: non-constant expression in ".if" statement
data/maps/CastbellePath/scripts.pory:81: Info: macro invoked from here
This is actually not a bug--Poryscript has always worked this way with var comparisons. Lowercase true only works with flag and defeated.
There may be an argument to automatically detect true/false and handled them gracefully, though. I'll re-purpose this issue to handle that. I'm surprised nobody has ever complained about this.
This is actually not a bug--Poryscript has always worked this way with
varcomparisons. Lowercasetrueonly works withflaganddefeated.
There may be an argument to automatically detect
true/falseand handled them gracefully, though. I'll re-purpose this issue to handle that. I'm surprised nobody has ever complained about this.
My bad! I thought true also worked for vars!
