From cef68cf821f5aa3412f52eb7c5b7ce247cf2d919 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Fri, 27 Feb 2004 11:01:14 +0000 Subject: [PATCH] is_module_loaded and is_plugin_loaded now return id on success, -1 on failure --- amxmodx/amxmod.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/amxmodx/amxmod.cpp b/amxmodx/amxmod.cpp index 25a1e558..d92f20bb 100755 --- a/amxmodx/amxmod.cpp +++ b/amxmodx/amxmod.cpp @@ -2066,12 +2066,14 @@ static cell AMX_NATIVE_CALL is_module_loaded(AMX *amx, cell *params) // param1: name int len; char *name = get_amxstring(amx, params[1], 0, len); + int id = 0; for (CList::iterator iter = g_modules.begin(); iter; ++iter) { if (stricmp((*iter).getName(), name) == 0) - return 1; + return id; + ++id; } - return 0; + return -1; } // native is_plugin_loaded(const name[]); @@ -2080,12 +2082,14 @@ static cell AMX_NATIVE_CALL is_plugin_loaded(AMX *amx, cell *params) // param1: name int len; char *name = get_amxstring(amx, params[1], 0, len); + int id = 0; for (CPluginMngr::iterator iter = g_plugins.begin(); iter; ++iter) { if (stricmp((*iter).getName(), name) == 0) - return 1; + return id; + ++id; } - return 0; + return -1; } // native get_modulesnum(); static cell AMX_NATIVE_CALL get_modulesnum(AMX *amx, cell *params)