MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnStartMessage_Pre

Method OnStartMessage_Pre

core/UserMessages.cpp:580–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type, const char *msg_name)
579#else
580bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_type)
581#endif
582{
583 bool is_intercept_empty = m_msgIntercepts[msg_type].empty();
584 bool is_hook_empty = m_msgHooks[msg_type].empty();
585
586 if ((is_intercept_empty && is_hook_empty)
587 || (m_InExec && (m_CurFlags & USERMSG_BLOCKHOOKS)))
588 {
589 m_InHook = false;
590 UM_RETURN_META_VALUE(MRES_IGNORED, NULL);
591 }
592
593 m_CurId = msg_type;
594 m_CurRecFilter = filter;
595 m_InHook = true;
596 m_BlockEndPost = false;
597
598 if (!is_intercept_empty)
599 {
600#ifdef USE_PROTOBUF_USERMESSAGES
601 if (m_InterceptBuffer)
602 delete m_InterceptBuffer;
603 m_InterceptBuffer = GetMessagePrototype(msg_type)->New();
604
605 UM_RETURN_META_VALUE(MRES_SUPERCEDE, m_InterceptBuffer);
606#else
607 m_InterceptBuffer.Reset();
608 UM_RETURN_META_VALUE(MRES_SUPERCEDE, &m_InterceptBuffer);
609#endif
610 }
611
612 UM_RETURN_META_VALUE(MRES_IGNORED, NULL);
613}
614
615#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
616protobuf::Message *UserMessages::OnStartMessage_Post(IRecipientFilter *filter, int msg_type, const char *msg_name)

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
NewMethod · 0.80
ResetMethod · 0.45

Tested by

no test coverage detected