Yes, it behaves differently. The old version looks incorrect, so it looks like my change may have fixed a bug.
verbChecks1 is a property. So the value of the expression:
(if (<= param1 4)
verbChecks1
)(else
verbChecks2
)
will be verbChecks1 or verbChecks2 depending on the value of param1. So that statement does nothing by itself, because nothing is checking the value of the expression (Companion used to spit out warnings in these cases, but I stopped doing that). It does modify the accumulator though (as you noted), so if that were all the code in the function, that result is what the function would return.
The first code snippet you posted is incorrect, because the expression in the second if statement is simply "verbChecks2", whereas it should be the entire first if statement there.
The formatting is better if you switch the language to Sierra Script:
(method (passedChecks param1 &tmp temp0)
(if
(and
(or
(not
(&
(= temp0
(&
(>>
(if (<= param1 4) verbChecks1 else verbChecks2)
(* 4 (mod (- param1 1) 4))
)
$000f
)
)
$0008
)
)
(self isNotHidden:)
)
(or (not (& temp0 $0004)) (self farCheck:))
(or (not (& temp0 $0002)) (self nearCheck:))
(not (not (& temp0 $0001)))
)
(self facingMe:)
)
)
Note that the function either returns the result of (self facingMe:), or 0 (what will be left in the accumulator in the branch not taken case).