Updated all module SDKs to stop the most annoying issue ever: amxxmodule.h required size_t but did not include stddef.h

Also stopped dodfun, dodx, tfcx and tsx from loading on games other than the ones they are designed for.
This commit is contained in:
Steve Dudenhoeffer 2008-04-29 06:53:55 +00:00
parent f410ea743d
commit 240c92e20f
42 changed files with 11497 additions and 11198 deletions

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>

View File

@ -294,6 +294,13 @@ void SetModel_Post(edict_t *e, const char *m)
RETURN_META(MRES_IGNORED);
}
int AmxxCheckGame(const char *game)
{
if (strcasecmp(game, "dod") == 0)
return AMXX_GAME_OK;
return AMXX_GAME_BAD;
}
void OnAmxxAttach()
{
MF_AddNatives( base_Natives );

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -46,6 +46,13 @@
/** AMXX query */
//#define FN_AMXX_QUERY OnAmxxQuery
/** AMXX Check Game - module API is NOT available here.
* Return AMXX_GAME_OK if this module can load on the game, AMXX_GAME_BAD if it cannot.
* syntax: int AmxxCheckGame(const char *game)
*/
#define FN_AMXX_CHECKGAME AmxxCheckGame
/** AMXX attach
* Do native functions init here (MF_AddNatives)
*/

View File

@ -471,6 +471,13 @@ void OnMetaAttach()
dodstats_pause = CVAR_GET_POINTER(init_dodstats_pause.name);
}
int AmxxCheckGame(const char *game)
{
if (strcasecmp(game, "dod") == 0)
return AMXX_GAME_OK;
return AMXX_GAME_BAD;
}
void OnAmxxAttach()
{
MF_AddNatives( stats_Natives );

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -46,6 +46,13 @@
/** AMXX query */
//#define FN_AMXX_QUERY OnAmxxQuery
/** AMXX Check Game - module API is NOT available here.
* Return AMXX_GAME_OK if this module can load on the game, AMXX_GAME_BAD if it cannot.
* syntax: int AmxxCheckGame(const char *game)
*/
#define FN_AMXX_CHECKGAME AmxxCheckGame
/** AMXX attach
* Do native functions init here (MF_AddNatives)
*/

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -331,6 +331,13 @@ void OnMetaAttach() {
}
int AmxxCheckGame(const char *game)
{
if (strcasecmp(game, "tfc") == 0)
return AMXX_GAME_OK;
return AMXX_GAME_BAD;
}
void OnAmxxAttach() {
MF_AddNatives( stats_Natives );

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -46,6 +46,13 @@
/** AMXX query */
//#define FN_AMXX_QUERY OnAmxxQuery
/** AMXX Check Game - module API is NOT available here.
* Return AMXX_GAME_OK if this module can load on the game, AMXX_GAME_BAD if it cannot.
* syntax: int AmxxCheckGame(const char *game)
*/
#define FN_AMXX_CHECKGAME AmxxCheckGame
/** AMXX attach
* Do native functions init here (MF_AddNatives)
*/

View File

@ -342,6 +342,13 @@ void OnPluginsLoaded()
g_death_info = MF_RegisterForward("client_death", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int AmxxCheckGame(const char *game)
{
if (strcasecmp(game, "ts") == 0)
return AMXX_GAME_OK;
return AMXX_GAME_BAD;
}
void OnAmxxAttach()
{

View File

@ -2548,6 +2548,14 @@ C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo
// request optional function
#define REQFUNC_OPT(name, fptr, type) fptr = (type)reqFnptrFunc(name)
C_DLLEXPORT int AMXX_CheckGame(const char *game)
{
#ifdef FN_AMXX_CHECKGAME
return FN_AMXX_CHECKGAME(game);
#else
return AMXX_GAME_OK;
#endif
}
C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
{
// Check pointer

View File

@ -10,6 +10,7 @@
// config
#include "moduleconfig.h"
#include <stddef.h> // size_t
// metamod include files
#ifdef USE_METAMOD
#include <extdll.h>
@ -55,6 +56,9 @@ struct amxx_module_info_s
#define AMXX_PARAM 2 /* Invalid parameter */
#define AMXX_FUNC_NOT_PRESENT 3 /* Function not present */
#define AMXX_GAME_OK 0 /* This module can load on the current game mod. */
#define AMXX_GAME_BAD 1 /* This module can not load on the current game mod. */
// *** Small stuff ***
// The next section is copied from the amx.h file
// Copyright (c) ITB CompuPhase, 1997-2005
@ -2023,6 +2027,10 @@ int FN_ShouldCollide_Post(edict_t *pentTouched, edict_t *pentOther);
void FN_AMXX_QUERY(void);
#endif // FN_AMXX_QUERY
#ifdef FN_AMXX_CHECKGAME
int FN_AMXX_CHECKGAME(const char *);
#endif // FN_AMXX_CHECKGAME
#ifdef FN_AMXX_ATTACH
void FN_AMXX_ATTACH(void);
#endif // FN_AMXX_ATTACH

View File

@ -46,6 +46,12 @@
/** AMXX query */
//#define FN_AMXX_QUERY OnAmxxQuery
/** AMXX Check Game - module API is NOT available here.
* Return AMXX_GAME_OK if this module can load on the game, AMXX_GAME_BAD if it cannot.
* syntax: int AmxxCheckGame(const char *game)
*/
#define FN_AMXX_CHECKGAME AmxxCheckGame
/** AMXX attach
* Do native functions init here (MF_AddNatives)
*/