From 418efa4088ee91dbe302f3702dc561d785cde24d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 10 Sep 2006 01:08:29 +0000 Subject: [PATCH] fixed bug am44544 (log forward broken) --- amxmodx/meta_api.cpp | 16 ++++++------- plugins/testsuite/logtest.sma | 45 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 plugins/testsuite/logtest.sma diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 9f859503..ea517e1e 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -1229,16 +1229,16 @@ void C_AlertMessage(ALERT_TYPE atype, char *szFmt, ...) { g_logevents.executeLogEvents(); } - - cell retVal = executeForwards(FF_PluginLog); - - if (retVal) - { - RETURN_META(MRES_HANDLED); - } } - RETURN_META(MRES_IGNORED); + cell retVal = executeForwards(FF_PluginLog); + + if (retVal) + { + RETURN_META(MRES_SUPERCEDE); + } + + RETURN_META(MRES_IGNORED); } void C_ChangeLevel(char *map, char *what) diff --git a/plugins/testsuite/logtest.sma b/plugins/testsuite/logtest.sma new file mode 100644 index 00000000..7767cea0 --- /dev/null +++ b/plugins/testsuite/logtest.sma @@ -0,0 +1,45 @@ +#include + +new g_BlockLog + +public plugin_init() +{ + register_plugin("Log Tester", "1.0", "BAILOPAN") + register_srvcmd("log_addlogevent", "Command_AddLogEvent") + register_srvcmd("log_setblock", "Command_LogSetBlock") +} + +public event_round_start() +{ + +} + +public Command_LogSetBlock() +{ + if (read_argc() < 2) + { + server_print("Specify 1 or 0.") + return PLUGIN_HANDLED + } + + new temp[12] + read_argv(1, temp, 11) + + g_BlockLog = str_to_num(temp) ? true : false + + return PLUGIN_HANDLED +} + +public plugin_log() +{ + server_print("Got log event! Blocking: %d", g_BlockLog) + + return g_BlockLog ? PLUGIN_HANDLED : PLUGIN_CONTINUE +} + +public Command_AddLogEvent(id) +{ + register_logevent("event_round_start", 2, "0=World triggered", "1=Round_Start") + + return PLUGIN_HANDLED +}