From afe19411b200bd0278f0fa86bfe16baf33539a88 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 10 May 2006 12:40:44 +0000 Subject: [PATCH] oh I forgot to commit this, basic-master-san --- amxmodx/modules.cpp | 26 +++++++++++++++++++++++++- amxmodx/sdk/amxxmodule.cpp | 2 ++ amxmodx/sdk/amxxmodule.h | 4 ++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index d7ee475b..db6c06b2 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -451,7 +451,25 @@ int CheckModules(AMX *amx, char error[128]) } found = FindLibrary(buffer, expect); - + + /* for binary compat */ + if (!found) + { + CList::iterator a = g_modules.begin(); + while (a) + { + CModule &cm = (*a); + if (cm.getInfoNew() && + cm.getInfoNew()->logtag && + !strcasecmp(cm.getInfoNew()->logtag, buffer)) + { + found = true; + break; + } + ++a; + } + } + if (!found) { if (pHandler->HandleModule(buffer)) @@ -1641,6 +1659,11 @@ int MNF_SetPlayerTeamInfo(int player, int teamid, const char *teamname) return 1; } +const char *MNF_GetLocalInfo(char *name, const char *def) +{ + return get_localinfo(name, def); +} + void *MNF_PlayerPropAddr(int id, int prop) { if (id < 1 || id > gpGlobals->maxClients) @@ -1786,6 +1809,7 @@ void Module_CacheFunctions() REGISTER_FUNC("AddLibraries", MFN_AddLibraries); REGISTER_FUNC("RemoveLibraries", MNF_RemoveLibraries); REGISTER_FUNC("OverrideNatives", MNF_OverrideNatives); + REGISTER_FUNC("GetLocalInfo", MNF_GetLocalInfo); #ifdef MEMORY_TEST REGISTER_FUNC("Allocator", m_allocator) diff --git a/amxmodx/sdk/amxxmodule.cpp b/amxmodx/sdk/amxxmodule.cpp index 73d69197..30ef9c79 100755 --- a/amxmodx/sdk/amxxmodule.cpp +++ b/amxmodx/sdk/amxxmodule.cpp @@ -2512,6 +2512,7 @@ PFN_FINDLIBRARY g_fn_FindLibrary; PFN_ADDLIBRARIES g_fn_AddLibraries; PFN_REMOVELIBRARIES g_fn_RemoveLibraries; PFN_OVERRIDENATIVES g_fn_OverrideNatives; +PFN_GETLOCALINFO g_fn_GetLocalInfo; // *** Exports *** C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo) @@ -2630,6 +2631,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) REQFUNC("AddLibraries", g_fn_AddLibraries, PFN_ADDLIBRARIES); REQFUNC("RemoveLibraries", g_fn_RemoveLibraries, PFN_REMOVELIBRARIES); REQFUNC("OverrideNatives", g_fn_OverrideNatives, PFN_OVERRIDENATIVES); + REQFUNC("GetLocalInfo", g_fn_GetLocalInfo, PFN_GETLOCALINFO); #ifdef MEMORY_TEST // Memory diff --git a/amxmodx/sdk/amxxmodule.h b/amxmodx/sdk/amxxmodule.h index 8be9c642..986e0eb4 100755 --- a/amxmodx/sdk/amxxmodule.h +++ b/amxmodx/sdk/amxxmodule.h @@ -2180,6 +2180,7 @@ typedef int (*PFN_FINDLIBRARY) (const char * /*name*/, LibType /*type*/); typedef size_t (*PFN_ADDLIBRARIES) (const char * /*name*/, LibType /*type*/, void * /*parent*/); typedef size_t (*PFN_REMOVELIBRARIES) (void * /*parent*/); typedef void (*PFN_OVERRIDENATIVES) (AMX_NATIVE_INFO * /*natives*/); +typedef const char * (*PFN_GETLOCALINFO) (const char * /*name*/, const char * /*def*/); extern PFN_ADD_NATIVES g_fn_AddNatives; extern PFN_BUILD_PATHNAME g_fn_BuildPathname; @@ -2251,6 +2252,7 @@ extern PFN_FINDLIBRARY g_fn_FindLibrary; extern PFN_ADDLIBRARIES g_fn_AddLibraries; extern PFN_REMOVELIBRARIES g_fn_RemoveLibraries; extern PFN_OVERRIDENATIVES g_fn_OverrideNatives; +extern PFN_GETLOCALINFO g_fn_GetLocalInfo; #ifdef MAY_NEVER_BE_DEFINED // Function prototypes for intellisense and similar systems @@ -2319,6 +2321,7 @@ int MF_FindLibrary (const char *name, LibType type) { } size_t MF_AddLibraries (const char *name, LibType type, void *parent) { } size_t MF_RemoveLibraries (void *parent) { } void MF_OverrideNatives (AMX_NATIVE_INFO *natives) { } +const char * MF_GetLocalInfo (const char *name, const char *def) { } #endif // MAY_NEVER_BE_DEFINED #define MF_AddNatives g_fn_AddNatives @@ -2392,6 +2395,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...); #define MF_AddLibraries g_fn_AddLibraries #define MF_RemoveLibraries g_fn_RemoveLibraries #define MF_OverrideNatives g_fn_OverrideNatives +#define MF_GetLocalInfo g_fn_GetLocalInfo #ifdef MEMORY_TEST /*** Memory ***/