It's better to make the `static_cast` line to `else` like this:
        
        CCRGBAProtocol *rgba = dynamic_cast<CCRGBAProtocol*>(obj);
        if(rgba)
        {
            rgba->updateDisplayedOpacity(parentOpacity);
        }
        else
        {
              CCNode *node = static_cast<CCNode*>(obj);
            CCRGBAProtocol::updateDisplayedOpacityChildren(node, parentOpacity);
        }