mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
new SDK
This commit is contained in:
parent
9922b5016f
commit
c12b04d302
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1955,7 +1961,7 @@ typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
||||||
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/);
|
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */);
|
||||||
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
||||||
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
||||||
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2687,8 +2687,6 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2802,7 +2800,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2815,7 +2813,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2829,7 +2827,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2841,7 +2839,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2860,8 +2858,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -2122,8 +2122,6 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
void *operator new[](size_t reportedSize);
|
void *operator new[](size_t reportedSize);
|
||||||
@ -2167,6 +2165,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1955,7 +1961,7 @@ typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
||||||
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/);
|
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/, int /* debug */);
|
||||||
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
||||||
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
||||||
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
typedef REAL (*PFN_CELL_TO_REAL) (cell /*x*/);
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
@ -2479,7 +2479,9 @@ PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
|||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2524,6 +2526,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||||
|
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||||
|
|
||||||
// Amx scripts
|
// Amx scripts
|
||||||
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
REQFUNC("GetAmxScript", g_fn_GetAmxScript, PFN_GET_AMXSCRIPT);
|
||||||
@ -2579,6 +2582,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
REQFUNC("GetPlayerArmor", g_fn_GetPlayerArmor, PFN_GET_PLAYER_ARMOR);
|
||||||
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
REQFUNC("GetPlayerHealth", g_fn_GetPlayerHealth, PFN_GET_PLAYER_HEALTH);
|
||||||
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
REQFUNC("GetPlayerFlags", g_fn_GetPlayerFlags, PFN_GETPLAYERFLAGS);
|
||||||
|
REQFUNC("GetPlayerEdict", g_fn_GetPlayerEdict, PFN_GET_PLAYER_EDICT);
|
||||||
|
|
||||||
// Memory
|
// Memory
|
||||||
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
REQFUNC_OPT("Allocator", g_fn_Allocator, PFN_ALLOCATOR);
|
||||||
@ -2673,16 +2677,17 @@ void ValidateMacros_DontCallThis_Smiley()
|
|||||||
MF_AmxExecv(0, 0, 0, 0, 0);
|
MF_AmxExecv(0, 0, 0, 0, 0);
|
||||||
MF_AmxFindPublic(0, 0, 0);
|
MF_AmxFindPublic(0, 0, 0);
|
||||||
MF_AmxAllot(0, 0, 0, 0);
|
MF_AmxAllot(0, 0, 0, 0);
|
||||||
MF_LoadAmxScript(0, 0, 0, 0);
|
MF_LoadAmxScript(0, 0, 0, 0, 0);
|
||||||
MF_UnloadAmxScript(0, 0);
|
MF_UnloadAmxScript(0, 0);
|
||||||
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForward(0, 0, 0, 0, 0, 0);
|
||||||
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
MF_RegisterSPForwardByName(0, 0, 0, 0, 0, 0);
|
||||||
MF_UnregisterSPForward(0);
|
MF_UnregisterSPForward(0);
|
||||||
|
MF_GetPlayerFrags(0);
|
||||||
|
MF_GetPlayerEdict(0);
|
||||||
|
MF_Format("", 4, "str");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MEMORY_TEST
|
|
||||||
|
|
||||||
/************* MEMORY *************/
|
/************* MEMORY *************/
|
||||||
// undef all defined macros
|
// undef all defined macros
|
||||||
#undef new
|
#undef new
|
||||||
@ -2796,7 +2801,7 @@ void *operator new(size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *operator new[](size_t reportedSize)
|
void *operator new[](size_t reportedSize)
|
||||||
@ -2809,7 +2814,7 @@ void *operator new[](size_t reportedSize)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Microsoft memory tracking operators
|
// Microsoft memory tracking operators
|
||||||
@ -2823,7 +2828,7 @@ void *operator new(size_t reportedSize, const char *sourceFile, int sourceLine)
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine)
|
||||||
{
|
{
|
||||||
@ -2835,7 +2840,7 @@ void *operator new[](size_t reportedSize, const char *sourceFile, int sourceLine
|
|||||||
return ptr;
|
return ptr;
|
||||||
|
|
||||||
// allocation failed
|
// allocation failed
|
||||||
throw std::bad_alloc();
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator delete(void *reportedAddress)
|
void operator delete(void *reportedAddress)
|
||||||
@ -2854,8 +2859,6 @@ void operator delete[](void *reportedAddress)
|
|||||||
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
Mem_Deallocator(g_Mem_CurrentFilename, g_Mem_CurrentLine, g_Mem_CurrentFunc, m_alloc_delete_array, reportedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
/************* stuff from dlls/util.cpp *************/
|
/************* stuff from dlls/util.cpp *************/
|
||||||
// must come here because cbase.h declares it's own operator new
|
// must come here because cbase.h declares it's own operator new
|
||||||
|
|
||||||
|
@ -1944,6 +1944,12 @@ typedef int (*PFN_IS_PLAYER_CONNECTING) (int /*id*/);
|
|||||||
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
typedef int (*PFN_IS_PLAYER_HLTV) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_ARMOR) (int /*id*/);
|
||||||
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
typedef int (*PFN_GET_PLAYER_HEALTH) (int /*id*/);
|
||||||
|
#ifdef USE_METAMOD
|
||||||
|
typedef edict_t * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#else
|
||||||
|
typedef void * (*PFN_GET_PLAYER_EDICT) (int /*id*/);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_ALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
const unsigned int /*type*/, const size_t /*size*/);
|
const unsigned int /*type*/, const size_t /*size*/);
|
||||||
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
typedef void * (*PFN_REALLOCATOR) (const char* /*filename*/, const unsigned int /*line*/, const char* /*func*/,
|
||||||
@ -1963,6 +1969,7 @@ typedef int (*PFN_REGISTER_SPFORWARD) (AMX * /*amx*/, int /*func*/, ... /*pa
|
|||||||
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
typedef int (*PFN_REGISTER_SPFORWARD_BYNAME) (AMX * /*amx*/, const char * /*funcName*/, ... /*params*/);
|
||||||
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
typedef void (*PFN_UNREGISTER_SPFORWARD) (int /*id*/);
|
||||||
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
typedef void (*PFN_MERGEDEFINITION_FILE) (const char * /*filename*/);
|
||||||
|
typedef const char * (*PFN_FORMAT) (const char * /*fmt*/, ... /*params*/);
|
||||||
|
|
||||||
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
extern PFN_ADD_NATIVES g_fn_AddNatives;
|
||||||
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
extern PFN_BUILD_PATHNAME g_fn_BuildPathname;
|
||||||
@ -2017,6 +2024,8 @@ extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
|||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||||
|
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||||
|
extern PFN_FORMAT g_fn_Format;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2066,6 +2075,8 @@ int MF_RegisterSPForwardByName (AMX * amx, const char *str, ...) { }
|
|||||||
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
int MF_RegisterSPForward (AMX * amx, int func, ...) { }
|
||||||
void MF_UnregisterSPForward (int id) { }
|
void MF_UnregisterSPForward (int id) { }
|
||||||
int MF_GetPlayerFlags (int id) { }
|
int MF_GetPlayerFlags (int id) { }
|
||||||
|
edict_t* MF_GetPlayerEdict (int id) { }
|
||||||
|
const char * MF_Format (const char *fmt, ...) { }
|
||||||
#endif // MAY_NEVER_BE_DEFINED
|
#endif // MAY_NEVER_BE_DEFINED
|
||||||
|
|
||||||
#define MF_AddNatives g_fn_AddNatives
|
#define MF_AddNatives g_fn_AddNatives
|
||||||
@ -2121,8 +2132,8 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
#define MF_RegisterSPForward g_fn_RegisterSPForward
|
||||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||||
|
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||||
#ifdef MEMORY_TEST
|
#define MF_Format g_fn_Format;
|
||||||
|
|
||||||
/*** Memory ***/
|
/*** Memory ***/
|
||||||
void *operator new(size_t reportedSize);
|
void *operator new(size_t reportedSize);
|
||||||
@ -2167,6 +2178,4 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons
|
|||||||
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
#define realloc(ptr,sz) Mem_Reallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_realloc,sz,ptr)
|
||||||
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
#define free(ptr) Mem_Deallocator(__FILE__,__LINE__,__FUNCTION__,m_alloc_free,ptr)
|
||||||
|
|
||||||
#endif //MEMORY_TEST
|
|
||||||
|
|
||||||
#endif // #ifndef __AMXXMODULE_H__
|
#endif // #ifndef __AMXXMODULE_H__
|
||||||
|
Loading…
Reference in New Issue
Block a user