Bit Flags work like this:

1111 = sight limited to 6, sight limited to 3, cannot use melee, and cannot advance are all true

1010 = sight limited to 6 and cannot use melee are true, the others are false

0001 = cannot advance is true, the others are all false

Doing a bitwise OR on each column will result in a 1 if any of them are true. In other words, if a flag is true for any one of the base classes, then the condition is true. The condition will only be false if the flags are false for all baseclasses.

For example:

1001 OR 0101 = 1101

0001 OR 0010 OR 0100 OR 1000 = 1111