From 5a612d22e574c4e8b290e1f30600c3bfd3f28ea3 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Thu, 2 Aug 2007 00:47:47 +0000 Subject: [PATCH] added new block_message flag in the message system --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401256 --- core/UserMessages.cpp | 14 +++++++------- plugins/include/usermessages.inc | 7 ++++--- public/IUserMessages.h | 3 +-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/UserMessages.cpp b/core/UserMessages.cpp index 89de32bd..b589a173 100644 --- a/core/UserMessages.cpp +++ b/core/UserMessages.cpp @@ -163,11 +163,11 @@ bf_write *UserMessages::StartMessage(int msg_id, cell_t players[], unsigned int m_InExec = true; - if (m_CurFlags & (USERMSG_PASSTHRU_ALL|USERMSG_PASSTHRU)) + if (m_CurFlags & USERMSG_BLOCKHOOKS) { - buffer = engine->UserMessageBegin(static_cast(&m_CellRecFilter), msg_id); - } else { buffer = ENGINE_CALL(UserMessageBegin)(static_cast(&m_CellRecFilter), msg_id); + } else { + buffer = engine->UserMessageBegin(static_cast(&m_CellRecFilter), msg_id); } return buffer; @@ -180,11 +180,11 @@ bool UserMessages::EndMessage() return false; } - if (m_CurFlags & (USERMSG_PASSTHRU_ALL|USERMSG_PASSTHRU)) + if (m_CurFlags & USERMSG_BLOCKHOOKS) { - engine->MessageEnd(); - } else { ENGINE_CALL(MessageEnd)(); + } else { + engine->MessageEnd(); } m_InExec = false; @@ -286,7 +286,7 @@ bf_write *UserMessages::OnStartMessage_Pre(IRecipientFilter *filter, int msg_typ bool is_hook_empty = m_msgHooks[msg_type].empty(); if ((is_intercept_empty && is_hook_empty) - || (m_InExec && !(m_CurFlags & USERMSG_PASSTHRU_ALL))) + || (m_InExec && (m_CurFlags & USERMSG_BLOCKHOOKS))) { m_InHook = false; RETURN_META_VALUE(MRES_IGNORED, NULL); diff --git a/plugins/include/usermessages.inc b/plugins/include/usermessages.inc index ad6d3677..513990b8 100644 --- a/plugins/include/usermessages.inc +++ b/plugins/include/usermessages.inc @@ -33,9 +33,10 @@ enum UserMsg #define USERMSG_PASSTHRU_ALL (1<<1) /**< (DEPRECATED, NO EFFECT) */ #define USERMSG_RELIABLE (1<<2) /**< Message will be set on the reliable stream */ #define USERMSG_INITMSG (1<<3) /**< Message will be considered to be an initmsg */ -#define USERMSG_BLOCK_MM (1<<4) /**< Message will be blocked from going through MM:S hooks */ -#define USERMSG_BLOCK_SM (1<<5) /**< Message will be blocked from going through SourceMod hooks */ -#define USERMSG_BLOCK_ALL (1<<6) /**< Message will be blocked from going through any hooks */ +#define USERMSG_BLOCK_MM (1<<4) /**< (DEPRECATED, NO EFFECT) */ +#define USERMSG_BLOCK_SM (1<<5) /**< (DEPRECATED, NO EFFECT) */ +#define USERMSG_BLOCK_ALL (1<<6) /**< (DEPRECATED, NO EFFECT) */ +#define USERMSG_BLOCKHOOKS (1<<7) /**< Prevents the message from triggering SourceMod and Metamod hooks */ /** * @endsection diff --git a/public/IUserMessages.h b/public/IUserMessages.h index 3a79ba9c..3c44bdb6 100644 --- a/public/IUserMessages.h +++ b/public/IUserMessages.h @@ -89,10 +89,9 @@ namespace SourceMod } }; - #define USERMSG_PASSTHRU (1<<0) /**< Message will pass through other SourceMM plugins */ - #define USERMSG_PASSTHRU_ALL (1<<1) /**< Message will pass through other SourceMM plugins AND SourceMod */ #define USERMSG_RELIABLE (1<<2) /**< Message will be set to reliable */ #define USERMSG_INITMSG (1<<3) /**< Message will be considered to be an initmsg */ + #define USERMSG_BLOCKHOOKS (1<<7) /**< Prevents the message from triggering SourceMod and Metamod hooks */ /** * @brief Contains functions for hooking user messages.