Make a function, static bool cPiston::IsMetaExtended(NIBBLETYPE a_BlockMeta), that returns true if the piston is extended when it has the specified meta. This will simplify the condition and will be re-usable.
I believe you got bitten by C++ operator precedence, the inequality operator (!=) is evaluated before the bitwise and (&).
I believe you got bitten by C++ operator precedence, the inequality operator (!=) is evaluated before the bitwise and (&).