From 2869c8f4f612946d95bf1dd80e04dcc4626f5740 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 18 Aug 2006 03:33:46 +0000 Subject: [PATCH] Fixed bug at43313 --- amxmodx/meta_api.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 98f9c523..3314873d 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -1192,10 +1192,12 @@ void C_TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t RETURN_META(MRES_IGNORED); } -void C_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...) +void C_AlertMessage(ALERT_TYPE atype, char *szFmt, ...) { if (atype != at_logged) + { RETURN_META(MRES_IGNORED); + } /* There are also more messages but we want only logs at_notice, @@ -1207,7 +1209,7 @@ void C_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...) */ // execute logevents and plugin_log forward - if (g_logevents.logEventsExist() || FF_PluginLog >= 0) + if (g_logevents.logEventsExist()) { va_list logArgPtr; va_start(logArgPtr, szFmt); @@ -1216,12 +1218,16 @@ void C_AlertMessage_Post(ALERT_TYPE atype, char *szFmt, ...) g_logevents.parseLogString(); if (g_logevents.logEventsExist()) + { g_logevents.executeLogEvents(); + } cell retVal = executeForwards(FF_PluginLog); if (retVal) + { RETURN_META(MRES_HANDLED); + } } RETURN_META(MRES_IGNORED); @@ -1575,6 +1581,8 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte meta_engfuncs.pfnWriteShort = C_WriteShort; meta_engfuncs.pfnWriteString = C_WriteString; + meta_engfuncs.pfnAlertMessage = C_AlertMessage; + memcpy(pengfuncsFromEngine, &meta_engfuncs, sizeof(enginefuncs_t)); return 1; @@ -1596,7 +1604,6 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int meta_engfuncs_post.pfnWriteCoord = C_WriteCoord_Post; meta_engfuncs_post.pfnWriteString = C_WriteString_Post; meta_engfuncs_post.pfnWriteEntity = C_WriteEntity_Post; - meta_engfuncs_post.pfnAlertMessage = C_AlertMessage_Post; meta_engfuncs_post.pfnRegUserMsg = C_RegUserMsg_Post; memcpy(pengfuncsFromEngine, &meta_engfuncs_post, sizeof(enginefuncs_t));