View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-06-2017 , 17:07   Re: [TUT] Bits, Bit-fields, and Bit-wise Operators
Reply With Quote #80

Quote:
Originally Posted by Bugsy View Post
SetUserBool(%1,%2) ( %1 |= (1 << (%2 - 1)))

You used |= instead of left shift and you should shift 1, not %1, but yea that will work as long as only 1 to 32 are inputted. Same logic as using ( %2 & 31 ).
Yeah, mistake.
eyal282 is offline