Thread: Private Data
View Single Post
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 12-19-2004 , 19:34  
Reply With Quote #10

Quote:
Originally Posted by Pimp Daddy
ok here is a question... lets say I get an offset and it contains like

(1<<1) | (1<<2) | (1<<3)

And I just want to set the (1<<1) to 0 ((0<<1))...

How would I do this?
The ~ (bitwise not) is what's needed to remove a flag.

So assuming (int) offsetValue has been set prior to this:
offsetValue &= ~(1<<1)
DS is offline