From 8cef1af95d9f5a1dbe06e9791554e26ad2108661 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sat, 19 Jul 2014 19:54:57 +0200 Subject: [PATCH] Move check out the loop. --- amxmodx/amxmodx.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 5f5c1d34..b7614b28 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -70,9 +70,14 @@ static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params) char* sName = get_amxstring(amx, params[1], 0, len); cell ptr; + if (!strcmp(sName, "MaxClients")) + { + return -1; + } + for (CPluginMngr::iterator a = g_plugins.begin(); a ; ++a) { - if ((*a).isValid() && amx_FindPubVar((*a).getAMX(), sName, &ptr) == AMX_ERR_NONE && strcmp(sName, "MaxClients")) + if ((*a).isValid() && amx_FindPubVar((*a).getAMX(), sName, &ptr) == AMX_ERR_NONE) return g_xvars.put((*a).getAMX(), get_amxaddr((*a).getAMX(), ptr)); }