From 00380cfe4c62912748a4d410d8070ce4da56416e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 2 Oct 2006 06:12:02 +0000 Subject: [PATCH] fixed a bug in get_func_id (thanks P34CH_34732) --- amxmodx/amxmodx.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index f255b4d4..d6861dd3 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -3301,19 +3301,30 @@ static cell AMX_NATIVE_CALL get_func_id(AMX *amx, cell *params) CPluginMngr::CPlugin *plugin; if (params[2] < 0) + { plugin = g_plugins.findPluginFast(amx); - else + } else { plugin = g_plugins.findPlugin(params[2]); + } if (!plugin) + { return -1; + } + + if (!plugin->isValid()) + { + return -1; + } int len; const char *funcName = get_amxstring(amx, params[1], 0, len); int index, err; if ((err = amx_FindPublic(plugin->getAMX(), funcName, &index)) != AMX_ERR_NONE) + { index = -1; + } return index; }