CUserMessageImplementation::CUserMessageImplementation(const CMRecipientFilter &recipient_filter, const char *message_name ) : IUsermessageImplementationBase(recipient_filter, message_name) { // Set the message index. set_message_index(); // TODO - Check if we should pass this as a non-const so we don't have to const-cast it. I'm sure I saw a constructor // somewhere requiring this to be passed as a const-ref somewhere m_buffer = engine->UserMessageBegin(&const_cast<CMRecipientFilter&>(recipient_filter), m_message_index); }
CUserMessageImplementation::CUserMessageImplementation( const MRecipientFilter &recipient_filter, const char *message_name ) : IUsermessageImplementationBase(recipient_filter, message_name), m_message(NULL) { // Set the message index. set_message_index(); // Eugh - I need to go take a shower after const casting... m_message = const_cast<google::protobuf::Message*>(g_Cstrike15UsermessageHelpers.GetPrototype(message_name)); }