Added check for mod game when a module loads: If the module has the optional function, and reports that it is not an expected game, the module will not load.

This should fix how some people seem to think the counter strike modules will work on games other than counter strike.
This commit is contained in:
Steve Dudenhoeffer
2008-04-27 00:07:06 +00:00
parent 4049a0c3be
commit 1d7cbd4203
18 changed files with 160 additions and 14 deletions

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