2014-08-04 10:10:06 +00:00
// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//
// Fakemeta Module
//
2004-07-28 03:14:07 +00:00
# include "fakemeta_amxx.h"
2014-08-09 18:50:45 +00:00
ke : : Vector < int > Engine [ ENGFUNC_NUM + 10 ] ;
ke : : Vector < int > EnginePost [ ENGFUNC_NUM + 10 ] ;
2007-01-28 05:01:38 +00:00
void * EngineAddrs [ ENGFUNC_NUM + 10 ] ;
void * EngineAddrsPost [ ENGFUNC_NUM + 10 ] ;
2004-07-28 03:14:07 +00:00
cell mCellResult ;
cell mlCellResult ;
float mFloatResult ;
float mlFloatResult ;
const char * mStringResult ;
const char * mlStringResult ;
int retType = 0 ;
int lastFmRes = FMRES_IGNORED ;
2006-03-20 18:08:51 +00:00
KVD_Wrapper g_kvd_hook ;
2006-04-30 07:27:14 +00:00
clientdata_t * g_cd_hook ;
entity_state_t * g_es_hook ;
usercmd_t * g_uc_hook ;
2004-07-28 03:14:07 +00:00
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
cell origCellRet ;
float origFloatRet ;
const char * origStringRet ;
2004-08-06 04:30:10 +00:00
# include "forwardmacros.h"
2004-07-28 03:14:07 +00:00
META_RES mswi ( int fmres )
{
if ( fmres = = FMRES_IGNORED )
return MRES_IGNORED ;
if ( fmres = = FMRES_HANDLED )
return MRES_HANDLED ;
if ( fmres = = FMRES_SUPERCEDE )
return MRES_SUPERCEDE ;
if ( fmres = = FMRES_OVERRIDE )
return MRES_OVERRIDE ;
return ( META_RES ) 0 ;
}
void clfm ( )
{
mCellResult = 0 ;
mlCellResult = 0 ;
mStringResult = " " ;
mlStringResult = " " ;
lastFmRes = FMRES_IGNORED ;
mFloatResult = 0.0 ;
mlFloatResult = 0.0 ;
}
static cell AMX_NATIVE_CALL fm_return ( AMX * amx , cell * params )
{
int len ;
switch ( params [ 1 ] )
{
case FMV_STRING :
{
mStringResult = STRING ( ALLOC_STRING ( MF_GetAmxString ( amx , params [ 2 ] , 0 , & len ) ) ) ;
break ;
}
case FMV_FLOAT :
{
2007-01-26 06:08:29 +00:00
mFloatResult = amx_ctof ( * ( MF_GetAmxAddr ( amx , params [ 2 ] ) ) ) ;
2004-07-28 03:14:07 +00:00
break ;
}
case FMV_CELL :
{
2007-01-26 06:08:29 +00:00
mCellResult = * ( MF_GetAmxAddr ( amx , params [ 2 ] ) ) ;
2004-07-28 03:14:07 +00:00
break ;
}
default :
{
return 0 ;
break ;
}
}
retType = params [ 1 ] ;
return 1 ;
}
2004-08-11 05:06:27 +00:00
/*
* Begining of Game DLL - > Engine hooks
*/
2004-08-05 20:57:03 +00:00
2004-08-06 00:56:48 +00:00
// pfnPrecacheModel
2013-02-13 07:14:37 +00:00
SIMPLE_INT_HOOK_CONSTSTRING ( PrecacheModel ) ;
2004-08-05 20:57:03 +00:00
2004-08-06 00:56:48 +00:00
// pfnPrecacheSound
2013-02-13 07:14:37 +00:00
SIMPLE_INT_HOOK_CONSTSTRING ( PrecacheSound ) ;
2004-07-28 03:14:07 +00:00
2006-03-30 00:31:33 +00:00
void ClientUserInfoChanged ( edict_t * e , char * infobuffer )
{
2006-05-10 11:19:24 +00:00
FM_ENG_HANDLE ( FM_ClientUserInfoChanged , ( Engine [ FM_ClientUserInfoChanged ] . at ( i ) , ( cell ) ENTINDEX ( e ) , ( cell ) infobuffer ) ) ;
2006-03-30 00:31:33 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void ClientUserInfoChanged_post ( edict_t * e , char * infobuffer )
{
2006-05-10 11:19:24 +00:00
FM_ENG_HANDLE_POST ( FM_ClientUserInfoChanged , ( EnginePost [ FM_ClientUserInfoChanged ] . at ( i ) , ( cell ) ENTINDEX ( e ) , ( cell ) infobuffer ) ) ;
2006-04-28 21:30:17 +00:00
RETURN_META ( MRES_IGNORED ) ;
2006-03-30 00:31:33 +00:00
}
2004-07-28 03:14:07 +00:00
void SetModel ( edict_t * e , const char * m )
{
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_SetModel , ( Engine [ FM_SetModel ] . at ( i ) , ( cell ) ENTINDEX ( e ) , m ) ) ;
2004-07-28 03:14:07 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
2004-08-06 03:01:45 +00:00
void SetModel_post ( edict_t * e , const char * m )
{
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_SetModel , ( EnginePost [ FM_SetModel ] . at ( i ) , ( cell ) ENTINDEX ( e ) , m ) ) ;
2004-08-06 03:01:45 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-07-28 03:14:07 +00:00
2004-09-14 06:16:52 +00:00
void TraceLine ( const float * v1 , const float * v2 , int fNoMonsters , edict_t * pentToSkip , TraceResult * ptr )
{
2004-09-15 18:40:18 +00:00
/*
TRACE_LINE ( v1 , v2 , fNoMonsters , pentToSkip , ptr ) ; //from fun module - prevents crash? - t(+)rget/freecode // well i guess that's what you get for listening, isnt it? =/
*/
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceLine , ( Engine [ FM_TraceLine ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
2004-09-14 06:16:52 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void TraceLine_post ( const float * v1 , const float * v2 , int fNoMonsters , edict_t * pentToSkip , TraceResult * ptr )
{
2004-09-15 18:40:18 +00:00
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceLine , ( EnginePost [ FM_TraceLine ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
2004-09-14 06:16:52 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
void TraceToss ( edict_t * pent , edict_t * pentToIgnore , TraceResult * ptr )
{
gfm_tr = ptr ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceToss , ( Engine [ FM_TraceToss ] . at ( i ) , ( cell ) ENTINDEX ( pent ) , ( cell ) ENTINDEX ( pentToIgnore ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void TraceToss_post ( edict_t * pent , edict_t * pentToIgnore , TraceResult * ptr )
{
gfm_tr = ptr ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceToss , ( EnginePost [ FM_TraceToss ] . at ( i ) , ( cell ) ENTINDEX ( pent ) , ( cell ) ENTINDEX ( pentToIgnore ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
int TraceMonsterHull ( edict_t * pEdict , const float * v1 , const float * v2 , int fNoMonsters , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceMonsterHull , ( Engine [ FM_TraceMonsterHull ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( mswi ( lastFmRes ) , ( int ) mlCellResult ) ;
}
int TraceMonsterHull_post ( edict_t * pEdict , const float * v1 , const float * v2 , int fNoMonsters , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
origCellRet = META_RESULT_ORIG_RET ( int ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceMonsterHull , ( EnginePost [ FM_TraceMonsterHull ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( MRES_IGNORED , ( int ) mlCellResult ) ;
}
void TraceHull ( const float * v1 , const float * v2 , int fNoMonsters , int hullNumber , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceHull , ( Engine [ FM_TraceHull ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) hullNumber , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void TraceHull_post ( const float * v1 , const float * v2 , int fNoMonsters , int hullNumber , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceHull , ( EnginePost [ FM_TraceHull ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , ( cell ) hullNumber , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
void TraceModel ( const float * v1 , const float * v2 , int hullNumber , edict_t * pent , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceModel , ( Engine [ FM_TraceModel ] . at ( i ) , p_v1 , p_v2 , ( cell ) hullNumber , ( cell ) ENTINDEX ( pent ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void TraceModel_post ( const float * v1 , const float * v2 , int hullNumber , edict_t * pent , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceModel , ( EnginePost [ FM_TraceModel ] . at ( i ) , p_v1 , p_v2 , ( cell ) hullNumber , ( cell ) ENTINDEX ( pent ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
const char * TraceTexture ( edict_t * pTextureEntity , const float * v1 , const float * v2 )
{
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceTexture , ( Engine [ FM_TraceTexture ] . at ( i ) , ( cell ) ENTINDEX ( pTextureEntity ) , p_v1 , p_v2 ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( mswi ( lastFmRes ) , mlStringResult ) ;
}
const char * TraceTexture_post ( edict_t * pTextureEntity , const float * v1 , const float * v2 )
{
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
origStringRet = META_RESULT_ORIG_RET ( const char * ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceTexture , ( EnginePost [ FM_TraceTexture ] . at ( i ) , ( cell ) ENTINDEX ( pTextureEntity ) , p_v1 , p_v2 ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( MRES_IGNORED , mlStringResult ) ;
}
void TraceSphere ( const float * v1 , const float * v2 , int fNoMonsters , float radius , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_TraceSphere , ( Engine [ FM_TraceSphere ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , radius , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void TraceSphere_post ( const float * v1 , const float * v2 , int fNoMonsters , float radius , edict_t * pentToSkip , TraceResult * ptr )
{
gfm_tr = ptr ;
PREPARE_VECTOR ( v1 ) ;
PREPARE_VECTOR ( v2 ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_TraceSphere , ( EnginePost [ FM_TraceSphere ] . at ( i ) , p_v1 , p_v2 , ( cell ) fNoMonsters , radius , ( cell ) ENTINDEX ( pentToSkip ) , ( cell ) ptr ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2005-03-25 09:30:45 +00:00
/*
// Passed to pfnKeyValue
typedef struct KeyValueData_s
{
char * szClassName ; // in: entity classname
char * szKeyName ; // in: name of key
char * szValue ; // in: value of key
int32 fHandled ; // out: DLL sets to true if key-value pair was understood
} KeyValueData ;
*/
2006-02-05 08:06:50 +00:00
void KeyValue ( edict_t * entity , KeyValueData * data )
{
2015-04-14 12:34:18 +00:00
FM_ENG_HANDLE ( FM_KeyValue , ( Engine [ FM_KeyValue ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) ( data ) ) ) ;
2005-03-25 09:30:45 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
2006-02-05 08:06:50 +00:00
void KeyValue_post ( edict_t * entity , KeyValueData * data )
{
2015-04-14 12:34:18 +00:00
FM_ENG_HANDLE_POST ( FM_KeyValue , ( EnginePost [ FM_KeyValue ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) ( data ) ) ) ;
2005-03-25 09:30:45 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2013-02-13 07:14:37 +00:00
void AlertMessage ( ALERT_TYPE atype , const char * szFmt , . . . )
2004-10-03 07:04:08 +00:00
{
static char buf [ 2048 ] ;
va_list ap ;
va_start ( ap , szFmt ) ;
vsprintf ( buf , szFmt , ap ) ;
va_end ( ap ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_AlertMessage , ( Engine [ FM_AlertMessage ] . at ( i ) , ( cell ) atype , buf ) ) ;
2004-10-03 07:04:08 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
2013-02-13 07:14:37 +00:00
void AlertMessage_post ( ALERT_TYPE atype , const char * szFmt , . . . )
2004-10-03 07:04:08 +00:00
{
static char buf [ 2048 ] ;
va_list ap ;
va_start ( ap , szFmt ) ;
vsprintf ( buf , szFmt , ap ) ;
va_end ( ap ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_AlertMessage , ( EnginePost [ FM_AlertMessage ] . at ( i ) , ( cell ) atype , buf ) ) ;
2004-10-03 07:04:08 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-08-06 00:56:48 +00:00
// pfnModelIndex
SIMPLE_INT_HOOK_CONSTSTRING ( ModelIndex ) ;
2004-07-28 03:14:07 +00:00
2004-08-06 00:56:48 +00:00
// pfnModelFrames
SIMPLE_INT_HOOK_INT ( ModelFrames ) ;
2004-07-28 03:14:07 +00:00
2004-08-11 05:06:27 +00:00
// pfnSetSize
SIMPLE_VOID_HOOK_EDICT_CONSTVECT_CONSTVECT ( SetSize ) ;
2004-07-28 03:14:07 +00:00
2004-08-11 05:06:27 +00:00
// pfnChangeLevel
2013-02-13 07:14:37 +00:00
SIMPLE_VOID_HOOK_CONSTSTRING_CONSTSTRING ( ChangeLevel ) ;
2004-07-28 03:14:07 +00:00
2004-08-11 05:06:27 +00:00
// pfnVecToYaw
SIMPLE_FLOAT_HOOK_CONSTVECT ( VecToYaw ) ;
2004-07-28 03:14:07 +00:00
void VecToAngles ( const float * rgflVectorIn , float * rgflVectorOut )
{
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
PREPARE_VECTOR ( rgflVectorIn ) ;
PREPARE_VECTOR ( rgflVectorOut ) ;
FM_ENG_HANDLE ( FM_VecToAngles , ( Engine [ FM_VecToAngles ] . at ( i ) , p_rgflVectorIn , p_rgflVectorOut ) ) ;
2004-07-28 03:14:07 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
2004-08-06 03:01:45 +00:00
void VecToAngles_post ( const float * rgflVectorIn , float * rgflVectorOut )
{
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
PREPARE_VECTOR ( rgflVectorIn ) ;
PREPARE_VECTOR ( rgflVectorOut ) ;
FM_ENG_HANDLE_POST ( FM_VecToAngles , ( EnginePost [ FM_VecToAngles ] . at ( i ) , p_rgflVectorIn , p_rgflVectorOut ) ) ;
2004-08-06 03:01:45 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-07-28 03:14:07 +00:00
void MoveToOrigin ( edict_t * ent , const float * pflGoal , float dist , int iMoveType )
{
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
PREPARE_VECTOR ( pflGoal ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_MoveToOrigin , ( Engine [ FM_MoveToOrigin ] . at ( i ) , ( cell ) ENTINDEX ( ent ) , p_pflGoal , dist , ( cell ) iMoveType ) ) ;
2004-07-28 03:14:07 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
2006-02-05 08:06:50 +00:00
2004-08-06 03:01:45 +00:00
void MoveToOrigin_post ( edict_t * ent , const float * pflGoal , float dist , int iMoveType )
{
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
PREPARE_VECTOR ( pflGoal ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_MoveToOrigin , ( EnginePost [ FM_MoveToOrigin ] . at ( i ) , ( cell ) ENTINDEX ( ent ) , p_pflGoal , dist , ( cell ) iMoveType ) ) ;
2004-08-06 03:01:45 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-07-28 03:14:07 +00:00
edict_t * FindEntityByString ( edict_t * pEdictStartSearchAfter , const char * pszField , const char * pszValue )
{
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_FindEntityByString , ( Engine [ FM_FindEntityByString ] . at ( i ) , ( cell ) ENTINDEX ( pEdictStartSearchAfter ) , pszField , pszValue ) ) ;
2015-10-06 21:53:01 +00:00
RETURN_META_VALUE ( mswi ( lastFmRes ) , TypeConversion . id_to_edict ( ( int ) mlCellResult ) ) ;
2004-07-28 03:14:07 +00:00
}
2006-02-05 08:06:50 +00:00
2004-08-06 03:01:45 +00:00
edict_t * FindEntityByString_post ( edict_t * pEdictStartSearchAfter , const char * pszField , const char * pszValue )
{
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
origCellRet = ENTINDEX ( META_RESULT_ORIG_RET ( edict_t * ) ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_FindEntityByString , ( EnginePost [ FM_FindEntityByString ] . at ( i ) , ( cell ) ENTINDEX ( pEdictStartSearchAfter ) , pszField , pszValue ) ) ;
2015-10-06 21:53:01 +00:00
RETURN_META_VALUE ( MRES_IGNORED , TypeConversion . id_to_edict ( ( int ) mlCellResult ) ) ;
2004-08-06 03:01:45 +00:00
}
2004-08-06 00:56:48 +00:00
// pfnGetEntityIllum
SIMPLE_INT_HOOK_EDICT ( GetEntityIllum ) ;
2004-07-28 03:14:07 +00:00
2004-08-11 05:06:27 +00:00
// pfnFindEntityInSphere
SIMPLE_EDICT_HOOK_EDICT_CONSTVECT_FLOAT ( FindEntityInSphere ) ;
// pfnFindClientInPVS
SIMPLE_EDICT_HOOK_EDICT ( FindClientInPVS ) ;
// pfnEntitiesInPVS
SIMPLE_EDICT_HOOK_EDICT ( EntitiesInPVS ) ;
// pfnMakeVectors
SIMPLE_VOID_HOOK_CONSTVECT ( MakeVectors ) ;
// pfnAngleVectors
SIMPLE_VOID_HOOK_CONSTVECT_VECT_VECT_VECT ( AngleVectors ) ;
2004-08-06 00:56:48 +00:00
// pfnChangeYaw
SIMPLE_VOID_HOOK_EDICT ( ChangeYaw ) ;
// pfnChangePitch
SIMPLE_VOID_HOOK_EDICT ( ChangePitch ) ;
2004-08-06 04:30:10 +00:00
// pfnCreateEntity
SIMPLE_EDICT_HOOK_VOID ( CreateEntity ) ;
2004-08-06 00:56:48 +00:00
// pfnRemoveEntity
SIMPLE_VOID_HOOK_EDICT ( RemoveEntity ) ;
2004-08-06 04:30:10 +00:00
// pfnCreateNamedEntity
SIMPLE_EDICT_HOOK_INT ( CreateNamedEntity ) ;
2004-08-06 00:56:48 +00:00
// pfnMakeStatic
SIMPLE_VOID_HOOK_EDICT ( MakeStatic ) ;
// pfnEntIsOnFloor
SIMPLE_INT_HOOK_EDICT ( EntIsOnFloor ) ;
// pfnDropToFloor
SIMPLE_INT_HOOK_EDICT ( DropToFloor ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
// pfnWalkMove
SIMPLE_INT_HOOK_EDICT_FLOAT_FLOAT_INT ( WalkMove ) ;
2004-08-11 05:06:27 +00:00
// pfnSetOrigin
SIMPLE_VOID_HOOK_EDICT_CONSTVECT ( SetOrigin ) ;
// pfnEmitSound
SIMPLE_VOID_HOOK_EDICT_INT_CONSTSTRING_FLOAT_FLOAT_INT_INT ( EmitSound ) ;
// pfnEmitAmbientSound
SIMPLE_VOID_HOOK_EDICT_VECT_CONSTSTRING_FLOAT_FLOAT_INT_INT ( EmitAmbientSound ) ;
// pfnGetAimVector
SIMPLE_VOID_HOOK_EDICT_FLOAT_VECT ( GetAimVector ) ;
// pfnParticleEffect
SIMPLE_VOID_HOOK_CONSTVECT_CONSTVECT_FLOAT_FLOAT ( ParticleEffect ) ;
// pfnLightStyle
2013-09-06 00:51:52 +00:00
SIMPLE_VOID_HOOK_INT_CONSTSTRING ( LightStyle ) ;
2004-08-11 05:06:27 +00:00
2004-08-06 04:30:10 +00:00
// pfnDecalIndex
SIMPLE_INT_HOOK_CONSTSTRING ( DecalIndex ) ;
2004-08-11 05:06:27 +00:00
// pfnPointContents
SIMPLE_INT_HOOK_CONSTVECT ( PointContents ) ;
// pfnMessageBegin
SIMPLE_VOID_HOOK_INT_INT_CONSTVECT_EDICT ( MessageBegin ) ;
// pfnMessageEnd
SIMPLE_VOID_HOOK_VOID ( MessageEnd ) ;
// pfnWriteByte
SIMPLE_VOID_HOOK_INT ( WriteByte ) ;
// pfnWriteChar
SIMPLE_VOID_HOOK_INT ( WriteChar ) ;
// pfnWriteShort
SIMPLE_VOID_HOOK_INT ( WriteShort ) ;
// pfnWriteLong
SIMPLE_VOID_HOOK_INT ( WriteLong ) ;
// pfnWriteAngle
SIMPLE_VOID_HOOK_FLOAT ( WriteAngle ) ;
// pfnWriteCoord
SIMPLE_VOID_HOOK_FLOAT ( WriteCoord ) ;
// pfnWriteString
SIMPLE_VOID_HOOK_CONSTSTRING ( WriteString ) ;
// pfnWriteEntity
SIMPLE_VOID_HOOK_INT ( WriteEntity ) ;
SIMPLE_FLOAT_HOOK_CONSTSTRING ( CVarGetFloat ) ;
SIMPLE_CONSTSTRING_HOOK_CONSTSTRING ( CVarGetString ) ;
SIMPLE_VOID_HOOK_CONSTSTRING_FLOAT ( CVarSetFloat ) ;
SIMPLE_VOID_HOOK_CONSTSTRING_CONSTSTRING ( CVarSetString ) ;
2004-08-06 04:30:10 +00:00
// pfnFreeEntPrivateData
SIMPLE_VOID_HOOK_EDICT ( FreeEntPrivateData ) ;
2004-08-11 05:06:27 +00:00
// pfnSzFromIndex
SIMPLE_CONSTSTRING_HOOK_INT ( SzFromIndex ) ;
2004-08-06 04:30:10 +00:00
// pfnAllocString
SIMPLE_INT_HOOK_CONSTSTRING ( AllocString ) ;
2004-08-11 05:06:27 +00:00
SIMPLE_INT_HOOK_CONSTSTRING_INT ( RegUserMsg ) ;
// pfnAnimationAutomove
SIMPLE_VOID_HOOK_CONSTEDICT_FLOAT ( AnimationAutomove ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
void GetBonePosition ( const edict_t * pEdict , int iBone , float * rgflOrigin , float * rgflAngles )
{
PREPARE_VECTOR ( rgflOrigin ) ;
PREPARE_VECTOR ( rgflAngles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_GetBonePosition , ( Engine [ FM_GetBonePosition ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) iBone , p_rgflOrigin , p_rgflAngles ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void GetBonePosition_post ( const edict_t * pEdict , int iBone , float * rgflOrigin , float * rgflAngles )
{
PREPARE_VECTOR ( rgflOrigin ) ;
PREPARE_VECTOR ( rgflAngles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_GetBonePosition , ( EnginePost [ FM_GetBonePosition ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) iBone , p_rgflOrigin , p_rgflAngles ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
void GetAttachment ( const edict_t * pEdict , int iAttachment , float * rgflOrigin , float * rgflAngles )
{
PREPARE_VECTOR ( rgflOrigin ) ;
PREPARE_VECTOR ( rgflAngles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_GetAttachment , ( Engine [ FM_GetAttachment ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) iAttachment , p_rgflOrigin , p_rgflAngles ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void GetAttachment_post ( const edict_t * pEdict , int iAttachment , float * rgflOrigin , float * rgflAngles )
{
PREPARE_VECTOR ( rgflOrigin ) ;
PREPARE_VECTOR ( rgflAngles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_GetAttachment , ( EnginePost [ FM_GetAttachment ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) iAttachment , p_rgflOrigin , p_rgflAngles ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-08-11 05:06:27 +00:00
// pfnSetView
SIMPLE_VOID_HOOK_CONSTEDICT_CONSTEDICT ( SetView ) ;
// pfnTime
SIMPLE_FLOAT_HOOK_VOID ( Time ) ;
// pfnCrosshairAngle
SIMPLE_VOID_HOOK_CONSTEDICT_FLOAT_FLOAT ( CrosshairAngle ) ;
SIMPLE_VOID_HOOK_CONSTEDICT_INT_INT_INT_INT ( FadeClientVolume ) ;
// pfnSetClientMaxspeed
SIMPLE_VOID_HOOK_CONSTEDICT_FLOAT ( SetClientMaxspeed ) ;
2004-08-06 04:30:10 +00:00
// pfnPrecacheGeneric
2013-02-13 07:14:37 +00:00
SIMPLE_INT_HOOK_CONSTSTRING ( PrecacheGeneric ) ;
2004-08-06 04:30:10 +00:00
2004-08-11 05:06:27 +00:00
// pfnPrecacheEvent
SIMPLE_USHORT_HOOK_INT_CONSTSTRING ( PrecacheEvent ) ;
// pfnGetPhysicsKeyValue
SIMPLE_CONSTSTRING_HOOK_CONSTEDICT_CONSTSTRING ( GetPhysicsKeyValue ) ;
// pfnSetPhysicsKeyValue
SIMPLE_VOID_HOOK_CONSTEDICT_CONSTSTRING_CONSTSTRING ( SetPhysicsKeyValue ) ;
// pfnGetPhysicsInfoString
SIMPLE_CONSTSTRING_HOOK_CONSTEDICT ( GetPhysicsInfoString ) ;
// pfnPlaybackEvent
HOOK_PLAYBACK_EVENT ( PlaybackEvent ) ;
// pfnCreateFakeClient
SIMPLE_EDICT_HOOK_CONSTSTRING ( CreateFakeClient ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
void RunPlayerMove ( edict_t * fakeclient , const float * viewangles , float forwardmove , float sidemove , float upmove , unsigned short buttons , byte impulse , byte msec )
{
PREPARE_VECTOR ( viewangles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_RunPlayerMove , ( Engine [ FM_RunPlayerMove ] . at ( i ) , ( cell ) ENTINDEX ( fakeclient ) , p_viewangles , forwardmove , sidemove , upmove , ( cell ) buttons , ( cell ) impulse , ( cell ) msec ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void RunPlayerMove_post ( edict_t * fakeclient , const float * viewangles , float forwardmove , float sidemove , float upmove , unsigned short buttons , byte impulse , byte msec )
{
PREPARE_VECTOR ( viewangles ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_RunPlayerMove , ( EnginePost [ FM_RunPlayerMove ] . at ( i ) , ( cell ) ENTINDEX ( fakeclient ) , p_viewangles , forwardmove , sidemove , upmove , ( cell ) buttons , ( cell ) impulse , ( cell ) msec ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-08-06 00:56:48 +00:00
// pfnNumberOfEntities
SIMPLE_INT_HOOK_VOID ( NumberOfEntities ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
void StaticDecal ( const float * origin , int decalIndex , int entityIndex , int modelIndex )
{
PREPARE_VECTOR ( origin ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_StaticDecal , ( Engine [ FM_StaticDecal ] . at ( i ) , p_origin , ( cell ) decalIndex , ( cell ) entityIndex , ( cell ) modelIndex ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void StaticDecal_post ( const float * origin , int decalIndex , int entityIndex , int modelIndex )
{
PREPARE_VECTOR ( origin ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_StaticDecal , ( EnginePost [ FM_StaticDecal ] . at ( i ) , p_origin , ( cell ) decalIndex , ( cell ) entityIndex , ( cell ) modelIndex ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
void BuildSoundMsg ( edict_t * entity , int channel , const char * sample , float volume , float attenuation , int fFlags , int pitch , int msg_dest , int msg_type , const float * pOrigin , edict_t * ed )
{
PREPARE_VECTOR ( pOrigin ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_BuildSoundMsg , ( Engine [ FM_BuildSoundMsg ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) channel , sample , volume , attenuation , ( cell ) fFlags , ( cell ) pitch , ( cell ) msg_dest , ( cell ) msg_type , p_pOrigin , ( cell ) ENTINDEX ( ed ) ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void BuildSoundMsg_post ( edict_t * entity , int channel , const char * sample , float volume , float attenuation , int fFlags , int pitch , int msg_dest , int msg_type , const float * pOrigin , edict_t * ed )
{
PREPARE_VECTOR ( pOrigin ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE_POST ( FM_BuildSoundMsg , ( EnginePost [ FM_BuildSoundMsg ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) channel , sample , volume , attenuation , ( cell ) fFlags , ( cell ) pitch , ( cell ) msg_dest , ( cell ) msg_type , p_pOrigin , ( cell ) ENTINDEX ( ed ) ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META ( MRES_IGNORED ) ;
}
int CheckVisibility ( const edict_t * entity , unsigned char * pset )
{
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_CheckVisibility , ( Engine [ FM_CheckVisibility ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) pset ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( mswi ( lastFmRes ) , ( int ) mlCellResult ) ;
}
int CheckVisibility_post ( const edict_t * entity , unsigned char * pset )
{
origCellRet = META_RESULT_ORIG_RET ( int ) ;
2006-04-28 21:30:17 +00:00
FM_ENG_HANDLE ( FM_CheckVisibility , ( Engine [ FM_CheckVisibility ] . at ( i ) , ( cell ) ENTINDEX ( entity ) , ( cell ) pset ) ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
RETURN_META_VALUE ( MRES_IGNORED , ( int ) mlCellResult ) ;
}
2004-08-06 04:30:10 +00:00
// pfnGetCurrentPlayer
SIMPLE_INT_HOOK_VOID ( GetCurrentPlayer ) ;
2004-08-06 00:56:48 +00:00
2004-08-11 05:06:27 +00:00
// pfnCanSkipPlayer
SIMPLE_INT_HOOK_CONSTEDICT ( CanSkipPlayer ) ;
// pfnSetGroupMask
SIMPLE_VOID_HOOK_INT_INT ( SetGroupMask ) ;
// pfnVoice_GetClientListening
SIMPLE_BOOL_HOOK_INT_INT ( Voice_GetClientListening ) ;
// pfnVoice_SetClientListening
SIMPLE_BOOL_HOOK_INT_INT_BOOL ( Voice_SetClientListening ) ;
2013-02-13 07:14:37 +00:00
SIMPLE_STRING_HOOK_STRING_CONSTSTRING ( InfoKeyValue ) ;
2004-08-11 05:06:27 +00:00
2013-02-13 07:14:37 +00:00
SIMPLE_VOID_HOOK_STRING_CONSTSTRING_CONSTSTRING ( SetKeyValue ) ;
2004-08-11 05:06:27 +00:00
2013-02-13 07:14:37 +00:00
SIMPLE_VOID_HOOK_INT_STRING_CONSTSTRING_CONSTSTRING ( SetClientKeyValue ) ;
2004-08-11 05:06:27 +00:00
SIMPLE_CONSTSTRING_HOOK_EDICT ( GetPlayerAuthId ) ;
SIMPLE_UINT_HOOK_EDICT ( GetPlayerWONId ) ;
2013-02-13 07:14:37 +00:00
SIMPLE_INT_HOOK_CONSTSTRING ( IsMapValid ) ;
2004-08-11 05:06:27 +00:00
2006-05-05 08:04:19 +00:00
int CreateInstancedBaseline ( int classname , struct entity_state_s * baseline )
{
g_es_hook = baseline ;
FM_ENG_HANDLE ( FM_CreateInstancedBaseline , ( Engine [ FM_CreateInstancedBaseline ] . at ( i ) , ( cell ) classname , ( cell ) baseline ) ) ;
RETURN_META_VALUE ( mswi ( lastFmRes ) , ( int ) mlCellResult ) ;
}
int CreateInstancedBaseline_post ( int classname , struct entity_state_s * baseline )
{
g_es_hook = baseline ;
origCellRet = META_RESULT_ORIG_RET ( int ) ;
FM_ENG_HANDLE_POST ( FM_CreateInstancedBaseline , ( EnginePost [ FM_CreateInstancedBaseline ] . at ( i ) , ( cell ) classname , ( cell ) baseline ) ) ;
RETURN_META_VALUE ( MRES_IGNORED , ( int ) mlCellResult ) ;
}
2006-05-10 11:19:24 +00:00
char * GetInfoKeyBuffer ( edict_t * e )
{
FM_ENG_HANDLE ( FM_GetInfoKeyBuffer , ( Engine [ FM_GetInfoKeyBuffer ] . at ( i ) , ( cell ) ENTINDEX ( e ) ) ) ;
RETURN_META_VALUE ( mswi ( lastFmRes ) , reinterpret_cast < char * > ( mlCellResult ) ) ;
}
char * GetInfoKeyBuffer_post ( edict_t * e )
{
origCellRet = reinterpret_cast < cell > ( META_RESULT_ORIG_RET ( char * ) ) ;
FM_ENG_HANDLE ( FM_GetInfoKeyBuffer , ( Engine [ FM_GetInfoKeyBuffer ] . at ( i ) , ( cell ) ENTINDEX ( e ) ) ) ;
RETURN_META_VALUE ( MRES_IGNORED , reinterpret_cast < char * > ( mlCellResult ) ) ;
}
2006-05-23 03:26:26 +00:00
void ClientPrintf ( edict_t * pEdict , PRINT_TYPE ptype , const char * szMsg )
{
FM_ENG_HANDLE ( FM_ClientPrintf , ( Engine [ FM_ClientPrintf ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) ptype , szMsg ) ) ;
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void ClientPrintf_post ( edict_t * pEdict , PRINT_TYPE ptype , const char * szMsg )
{
FM_ENG_HANDLE ( FM_ClientPrintf , ( Engine [ FM_ClientPrintf ] . at ( i ) , ( cell ) ENTINDEX ( pEdict ) , ( cell ) ptype , szMsg ) ) ;
RETURN_META ( MRES_IGNORED ) ;
}
2007-04-30 18:29:33 +00:00
SIMPLE_VOID_HOOK_CONSTSTRING ( ServerPrint ) ;
2004-08-06 00:56:48 +00:00
/*
2004-08-11 05:06:27 +00:00
* Beginning of Engine - > Game DLL hooks
2004-08-06 00:56:48 +00:00
*/
// pfnSpawn
SIMPLE_INT_HOOK_EDICT ( Spawn ) ;
// pfnThink
SIMPLE_VOID_HOOK_EDICT ( Think ) ;
// pfnUse
SIMPLE_VOID_HOOK_EDICT_EDICT ( Use ) ;
// pfnTouch
SIMPLE_VOID_HOOK_EDICT_EDICT ( Touch ) ;
// pfnBlocked
SIMPLE_VOID_HOOK_EDICT_EDICT ( Blocked ) ;
// pfnSetAbsBox
SIMPLE_VOID_HOOK_EDICT ( SetAbsBox ) ;
2004-08-11 05:06:27 +00:00
// pfnClientConnect
SIMPLE_BOOL_HOOK_EDICT_CONSTSTRING_CONSTSTRING_STRING128 ( ClientConnect ) ;
2004-08-06 00:56:48 +00:00
// pfnClientDisconnect
SIMPLE_VOID_HOOK_EDICT ( ClientDisconnect ) ;
// pfnClientPutInServer
SIMPLE_VOID_HOOK_EDICT ( ClientPutInServer ) ;
// pfnClientKill
SIMPLE_VOID_HOOK_EDICT ( ClientKill ) ;
// pfnClientCommand
SIMPLE_VOID_HOOK_EDICT ( ClientCommand ) ;
// pfnServerDeactivate
SIMPLE_VOID_HOOK_VOID ( ServerDeactivate ) ;
// pfnPlayerPreThink
SIMPLE_VOID_HOOK_EDICT ( PlayerPreThink ) ;
// pfnPlayerPostThink
SIMPLE_VOID_HOOK_EDICT ( PlayerPostThink ) ;
// pfnStartFrame
SIMPLE_VOID_HOOK_VOID ( StartFrame ) ;
// pfnParmsNewLevel
SIMPLE_VOID_HOOK_VOID ( ParmsNewLevel ) ;
// pfnParmsChangeLevel
SIMPLE_VOID_HOOK_VOID ( ParmsChangeLevel ) ;
2004-08-06 04:30:10 +00:00
// pfnGetGameDescription
SIMPLE_CONSTSTRING_HOOK_VOID ( GetGameDescription ) ;
2004-08-06 00:56:48 +00:00
// pfnSpectatorConnect
SIMPLE_VOID_HOOK_EDICT ( SpectatorConnect ) ;
// pfnSpectatorDisconnect
SIMPLE_VOID_HOOK_EDICT ( SpectatorDisconnect ) ;
// pfnSpectatorThink
SIMPLE_VOID_HOOK_EDICT ( SpectatorThink ) ;
2004-07-28 03:14:07 +00:00
2004-08-06 04:30:10 +00:00
// pfnSys_Error
SIMPLE_VOID_HOOK_CONSTSTRING ( Sys_Error ) ;
// pfnPM_FindTextureType
2013-02-13 07:14:37 +00:00
SIMPLE_CHAR_HOOK_CONSTSTRING ( PM_FindTextureType ) ;
2004-08-06 04:30:10 +00:00
// pfnRegisterEncoders
SIMPLE_VOID_HOOK_VOID ( RegisterEncoders ) ;
2004-08-06 03:01:45 +00:00
// pfnCreateInstancedBaselines
SIMPLE_VOID_HOOK_VOID ( CreateInstancedBaselines ) ;
// pfnAllowLagCompensation
SIMPLE_INT_HOOK_VOID ( AllowLagCompensation ) ;
2004-08-06 04:30:10 +00:00
2006-04-30 07:27:14 +00:00
void UpdateClientData ( const struct edict_s * ent , int sendweapons , struct clientdata_s * cd )
{
g_cd_hook = cd ;
FM_ENG_HANDLE ( FM_UpdateClientData , ( Engine [ FM_UpdateClientData ] . at ( i ) , ( cell ) ENTINDEX ( ent ) , ( cell ) sendweapons , ( cell ) cd ) ) ;
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void UpdateClientData_post ( const struct edict_s * ent , int sendweapons , struct clientdata_s * cd )
{
g_cd_hook = cd ;
FM_ENG_HANDLE_POST ( FM_UpdateClientData , ( EnginePost [ FM_UpdateClientData ] . at ( i ) , ( cell ) ENTINDEX ( ent ) , ( cell ) sendweapons , ( cell ) cd ) ) ;
RETURN_META ( MRES_IGNORED ) ;
}
int AddToFullPack ( struct entity_state_s * state , int e , edict_t * ent , edict_t * host , int hostflags , int player , unsigned char * pSet )
{
g_es_hook = state ;
FM_ENG_HANDLE ( FM_AddToFullPack , ( Engine [ FM_AddToFullPack ] . at ( i ) , ( cell ) state , ( cell ) e , ( cell ) ENTINDEX ( ent ) , ( cell ) ENTINDEX ( host ) , ( cell ) hostflags , ( cell ) player , ( cell ) pSet ) ) ;
RETURN_META_VALUE ( mswi ( lastFmRes ) , ( int ) mlCellResult ) ;
}
int AddToFullPack_post ( struct entity_state_s * state , int e , edict_t * ent , edict_t * host , int hostflags , int player , unsigned char * pSet )
{
g_es_hook = state ;
origCellRet = META_RESULT_ORIG_RET ( int ) ;
FM_ENG_HANDLE_POST ( FM_AddToFullPack , ( EnginePost [ FM_AddToFullPack ] . at ( i ) , ( cell ) state , ( cell ) e , ( cell ) ENTINDEX ( ent ) , ( cell ) ENTINDEX ( host ) , ( cell ) hostflags , ( cell ) player , ( cell ) pSet ) ) ;
RETURN_META_VALUE ( MRES_IGNORED , ( int ) mlCellResult ) ;
}
void CmdStart ( const edict_t * player , const struct usercmd_s * cmd , unsigned int random_seed )
{
g_uc_hook = const_cast < usercmd_t * > ( cmd ) ;
FM_ENG_HANDLE ( FM_CmdStart , ( Engine [ FM_CmdStart ] . at ( i ) , ( cell ) ENTINDEX ( player ) , ( cell ) cmd , ( cell ) random_seed ) ) ;
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void CmdStart_post ( const edict_t * player , const struct usercmd_s * cmd , unsigned int random_seed )
{
g_uc_hook = const_cast < usercmd_t * > ( cmd ) ;
FM_ENG_HANDLE_POST ( FM_CmdStart , ( EnginePost [ FM_CmdStart ] . at ( i ) , ( cell ) ENTINDEX ( player ) , ( cell ) cmd , ( cell ) random_seed ) ) ;
RETURN_META ( MRES_IGNORED ) ;
}
2006-05-05 08:04:19 +00:00
void CreateBaseline ( int player , int eindex , struct entity_state_s * baseline , struct edict_s * entity , int playermodelindex , vec3_t player_mins , vec3_t player_maxs )
{
g_es_hook = baseline ;
PREPARE_VECTOR ( player_mins ) ;
PREPARE_VECTOR ( player_maxs ) ;
FM_ENG_HANDLE ( FM_CreateBaseline , ( Engine [ FM_CreateBaseline ] . at ( i ) , ( cell ) player , ( cell ) eindex , ( cell ) baseline , ( cell ) ENTINDEX ( entity ) , ( cell ) playermodelindex , p_player_mins , p_player_maxs ) ) ;
RETURN_META ( mswi ( lastFmRes ) ) ;
}
void CreateBaseline_post ( int player , int eindex , struct entity_state_s * baseline , struct edict_s * entity , int playermodelindex , vec3_t player_mins , vec3_t player_maxs )
{
g_es_hook = baseline ;
PREPARE_VECTOR ( player_mins ) ;
PREPARE_VECTOR ( player_maxs ) ;
FM_ENG_HANDLE_POST ( FM_CreateBaseline , ( EnginePost [ FM_CreateBaseline ] . at ( i ) , ( cell ) player , ( cell ) eindex , ( cell ) baseline , ( cell ) ENTINDEX ( entity ) , ( cell ) playermodelindex , p_player_mins , p_player_maxs ) ) ;
RETURN_META ( MRES_IGNORED ) ;
}
2006-04-30 07:27:14 +00:00
// pfnCmdEnd
SIMPLE_VOID_HOOK_CONSTEDICT ( CmdEnd ) ;
2004-08-06 04:30:10 +00:00
2005-08-18 09:33:51 +00:00
/*
* NEW_DLL_FUNCTIONS
*/
// pfnOnFreeEntPrivateData
SIMPLE_VOID_HOOK_EDICT ( OnFreeEntPrivateData ) ;
// pfnGameShutdown
SIMPLE_VOID_HOOK_VOID ( GameShutdown ) ;
// pfnShouldCollide
SIMPLE_INT_HOOK_EDICT_EDICT ( ShouldCollide ) ;
2004-08-06 04:30:10 +00:00
2006-02-03 03:27:03 +00:00
static cell AMX_NATIVE_CALL unregister_forward ( AMX * amx , cell * params )
{
int func = params [ 1 ] ;
int func_id = params [ 2 ] ;
int post = params [ 3 ] ;
if ( func > = FM_LAST_DONT_USE_ME | | func < 1 )
{
MF_LogError ( amx , AMX_ERR_NATIVE , " Invalid function: %d " , func ) ;
return 0 ;
}
2007-01-28 05:01:38 +00:00
void * patchAddr = NULL ;
2014-08-09 18:50:45 +00:00
ke : : Vector < int > * peng = NULL ;
2006-02-03 03:28:43 +00:00
if ( post )
2007-01-28 05:01:38 +00:00
{
2006-02-03 03:28:43 +00:00
peng = & ( EnginePost [ func ] ) ;
2007-01-28 05:01:38 +00:00
patchAddr = EngineAddrsPost [ func ] ;
} else {
2006-10-25 16:54:37 +00:00
peng = & ( Engine [ func ] ) ;
2007-01-28 05:01:38 +00:00
patchAddr = EngineAddrs [ func ] ;
}
2014-08-09 18:50:45 +00:00
for ( size_t i = 0 ; i < peng - > length ( ) ; + + i )
2006-02-03 03:27:03 +00:00
{
2014-08-09 18:50:45 +00:00
if ( peng - > at ( i ) = = func_id )
2006-02-03 03:27:03 +00:00
{
2014-08-09 18:50:45 +00:00
peng - > remove ( i ) ;
if ( ! peng - > length ( ) & & patchAddr ! = NULL & & func ! = FM_ServerDeactivate )
2006-02-03 03:27:03 +00:00
{
2007-01-28 05:01:38 +00:00
/* Clear out this forward if we no longer need it */
* ( void * * ) patchAddr = NULL ;
2006-02-03 03:27:03 +00:00
}
return 1 ;
}
}
return 0 ;
}
2004-08-06 04:30:10 +00:00
2004-07-28 03:14:07 +00:00
static cell AMX_NATIVE_CALL register_forward ( AMX * amx , cell * params )
{
int func = params [ 1 ] ;
2004-08-06 00:56:48 +00:00
// You originally had both post coming from params[2] AND the function name. I've moved post to 3.
int post = params [ 3 ] ;
2004-10-16 14:26:11 +00:00
if ( func > = FM_LAST_DONT_USE_ME | | func < 1 )
2004-07-28 03:14:07 +00:00
{
2006-02-03 03:27:03 +00:00
MF_LogError ( amx , AMX_ERR_NATIVE , " Invalid function: %d " , func ) ;
2004-07-28 03:14:07 +00:00
return 0 ;
}
int len , fId = 0 ;
const char * funcname = MF_GetAmxString ( amx , params [ 2 ] , 0 , & len ) ;
enginefuncs_t * engtable ;
2004-08-06 00:56:48 +00:00
DLL_FUNCTIONS * dlltable ;
2005-08-18 09:33:51 +00:00
NEW_DLL_FUNCTIONS * newdlltable ;
2004-07-28 03:14:07 +00:00
if ( post )
2004-08-06 00:56:48 +00:00
{
engtable = g_pengfuncsTable_Post ;
dlltable = g_pFunctionTable_Post ;
2005-08-18 09:33:51 +00:00
newdlltable = g_pNewFunctionsTable_Post ;
2004-08-06 00:56:48 +00:00
}
2004-07-28 03:14:07 +00:00
else
2004-08-06 00:56:48 +00:00
{
engtable = g_pengfuncsTable ;
dlltable = g_pFunctionTable ;
2005-08-18 09:33:51 +00:00
newdlltable = g_pNewFunctionsTable ;
2004-08-06 00:56:48 +00:00
}
2006-03-04 06:34:28 +00:00
2004-07-28 03:14:07 +00:00
switch ( func )
{
case FM_PrecacheModel :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( PrecacheModel ) ;
break ;
case FM_PrecacheSound :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( PrecacheSound ) ;
break ;
case FM_SetModel :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_DONE ) ;
ENGHOOK ( SetModel ) ;
break ;
case FM_ModelIndex :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( ModelIndex ) ;
break ;
case FM_ModelFrames :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( ModelFrames ) ;
break ;
case FM_SetSize :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
ENGHOOK ( SetSize ) ;
break ;
case FM_ChangeLevel :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_STRING , FP_DONE ) ;
ENGHOOK ( ChangeLevel ) ;
break ;
case FM_VecToYaw :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_DONE ) ;
ENGHOOK ( VecToYaw ) ;
break ;
case FM_VecToAngles :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
ENGHOOK ( VecToAngles ) ;
break ;
case FM_MoveToOrigin :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_FLOAT , FP_CELL , FP_DONE ) ;
ENGHOOK ( MoveToOrigin ) ;
break ;
case FM_ChangeYaw :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( ChangeYaw ) ;
break ;
case FM_ChangePitch :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( ChangePitch ) ;
break ;
case FM_FindEntityByString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_STRING , FP_DONE ) ;
ENGHOOK ( FindEntityByString ) ;
break ;
case FM_GetEntityIllum :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( GetEntityIllum ) ;
break ;
case FM_FindEntityInSphere :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_FLOAT , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( FindEntityInSphere ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_FindClientInPVS :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( FindClientInPVS ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_EntitiesInPVS :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( EntitiesInPVS ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_MakeVectors :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( MakeVectors ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_AngleVectors :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( AngleVectors ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_CreateEntity :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( CreateEntity ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_RemoveEntity :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
ENGHOOK ( RemoveEntity ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_CreateNamedEntity :
2004-08-11 05:06:27 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( CreateNamedEntity ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_MakeStatic :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
ENGHOOK ( MakeStatic ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_EntIsOnFloor :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
ENGHOOK ( EntIsOnFloor ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_DropToFloor :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
ENGHOOK ( DropToFloor ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_WalkMove :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_FLOAT , FP_FLOAT , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( WalkMove ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_SetOrigin :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetOrigin ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_EmitSound :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_STRING , FP_FLOAT , FP_FLOAT , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( EmitSound ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_EmitAmbientSound :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_STRING , FP_FLOAT , FP_FLOAT , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( EmitAmbientSound ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceLine :
2006-03-20 18:08:51 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
2004-09-14 06:16:52 +00:00
ENGHOOK ( TraceLine ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceToss :
2007-01-17 05:32:45 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceToss ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceMonsterHull :
2007-01-17 05:32:45 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_ARRAY , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceMonsterHull ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceHull :
2007-01-17 05:32:45 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceHull ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceModel :
2007-01-17 05:32:45 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceModel ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceTexture :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceTexture ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_TraceSphere :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_CELL , FP_FLOAT , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( TraceSphere ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_GetAimVector :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_FLOAT , FP_ARRAY , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( GetAimVector ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_ParticleEffect :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_ARRAY , FP_FLOAT , FP_FLOAT , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( ParticleEffect ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_LightStyle :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( LightStyle ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_DecalIndex :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( DecalIndex ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_PointContents :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( PointContents ) ;
break ;
case FM_MessageBegin :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_ARRAY , FP_CELL , FP_DONE ) ;
ENGHOOK ( MessageBegin ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
case FM_MessageEnd :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
ENGHOOK ( MessageEnd ) ;
break ;
case FM_WriteByte :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( WriteByte ) ;
break ;
case FM_WriteChar :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( WriteChar ) ;
break ;
case FM_WriteShort :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( WriteShort ) ;
break ;
case FM_WriteLong :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( WriteLong ) ;
break ;
case FM_WriteAngle :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_FLOAT , FP_DONE ) ;
ENGHOOK ( WriteAngle ) ;
break ;
case FM_WriteCoord :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_FLOAT , FP_DONE ) ;
ENGHOOK ( WriteCoord ) ;
break ;
case FM_WriteString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( WriteString ) ;
break ;
case FM_WriteEntity :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( WriteEntity ) ;
break ;
case FM_CVarGetFloat :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( CVarGetFloat ) ;
break ;
case FM_CVarGetString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( CVarGetString ) ;
break ;
case FM_CVarSetFloat :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_FLOAT , FP_DONE ) ;
ENGHOOK ( CVarSetFloat ) ;
break ;
case FM_CVarSetString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_STRING , FP_DONE ) ;
ENGHOOK ( CVarSetString ) ;
break ;
2004-07-28 03:14:07 +00:00
case FM_FreeEntPrivateData :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( FreeEntPrivateData ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_SzFromIndex :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SzFromIndex ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_AllocString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( AllocString ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_RegUserMsg :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( RegUserMsg ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_AnimationAutomove :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_FLOAT , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( AnimationAutomove ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_GetBonePosition :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( GetBonePosition ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_GetAttachment :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( GetAttachment ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_SetView :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetView ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_Time :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( Time ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_CrosshairAngle :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_FLOAT , FP_FLOAT , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( CrosshairAngle ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_FadeClientVolume :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( FadeClientVolume ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_SetClientMaxspeed :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_FLOAT , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetClientMaxspeed ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_CreateFakeClient :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( CreateFakeClient ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_RunPlayerMove :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_ARRAY , FP_FLOAT , FP_FLOAT , FP_FLOAT , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( RunPlayerMove ) ;
2004-07-28 03:14:07 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-07-28 03:14:07 +00:00
case FM_NumberOfEntities :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
ENGHOOK ( NumberOfEntities ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_StaticDecal :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_ARRAY , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( StaticDecal ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_PrecacheGeneric :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( PrecacheGeneric ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_BuildSoundMsg :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_STRING , FP_FLOAT , FP_FLOAT , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_ARRAY , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( BuildSoundMsg ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_GetPhysicsKeyValue :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( GetPhysicsKeyValue ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_SetPhysicsKeyValue :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetPhysicsKeyValue ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_GetPhysicsInfoString :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( GetPhysicsInfoString ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_PrecacheEvent :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( PrecacheEvent ) ;
2004-07-28 03:14:07 +00:00
break ;
case FM_PlaybackEvent :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_FLOAT , FP_ARRAY , FP_ARRAY , FP_FLOAT , FP_FLOAT , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( PlaybackEvent ) ; // waaaaaaaaaah, its so damn big. :~(
2004-07-28 03:14:07 +00:00
break ;
2004-08-03 19:45:48 +00:00
//EngFunc_CheckVisibility, //) ( const edict_t *entity, unsigned char *pset );
case FM_CheckVisibility :
2006-04-30 07:27:14 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
ENGHOOK ( CheckVisibility ) ;
2004-08-03 19:45:48 +00:00
break ;
case FM_GetCurrentPlayer :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
ENGHOOK ( GetCurrentPlayer ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_CanSkipPlayer, //) ( const edict_t *player );
case FM_CanSkipPlayer :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( CanSkipPlayer ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_SetGroupMask, //) ( int mask, int op );
case FM_SetGroupMask :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetGroupMask ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_GetClientListening, // bool (int iReceiver, int iSender)
2004-08-06 03:01:45 +00:00
case FM_Voice_GetClientListening :
2004-08-03 19:45:48 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( Voice_GetClientListening ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_SetClientListening, // bool (int iReceiver, int iSender, bool Listen)
2004-08-06 03:01:45 +00:00
case FM_Voice_SetClientListening :
2004-08-03 19:45:48 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ; // TODO: bool as cell 3rd arg?
2004-08-11 05:06:27 +00:00
ENGHOOK ( Voice_SetClientListening ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_InfoKeyValue, // char* ) (char *infobuffer, char *key);
case FM_InfoKeyValue :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( InfoKeyValue ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value);
case FM_SetKeyValue :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_STRING , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetKeyValue ) ;
2004-08-03 19:45:48 +00:00
break ;
//EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value);
case FM_SetClientKeyValue :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_STRING , FP_STRING , FP_DONE ) ;
2004-08-11 05:06:27 +00:00
ENGHOOK ( SetClientKeyValue ) ;
break ;
case FM_GetPlayerAuthId :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( GetPlayerAuthId ) ;
break ;
case FM_GetPlayerWONId :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( GetPlayerWONId ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
case FM_IsMapValid :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( IsMapValid ) ;
break ;
2004-10-03 07:04:08 +00:00
case FM_AlertMessage :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_DONE ) ;
ENGHOOK ( AlertMessage ) ;
break ;
2004-08-06 00:56:48 +00:00
/*
* Begin of DLLFuncs
*/
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_Spawn :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( Spawn ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_Think :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( Think ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_Use :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( Use ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_Touch :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( Touch ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_Blocked :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( Blocked ) ;
2004-08-03 19:45:48 +00:00
break ;
2005-03-25 09:30:45 +00:00
//TODO: Expand the structure (simple: just a bunch of strings and a float.)
2004-08-11 05:06:27 +00:00
//DLLFunc_KeyValue, // void ) ( edict_t *pentKeyvalue, KeyValueData *pkvd );
2004-08-03 19:45:48 +00:00
case FM_KeyValue :
2005-03-25 09:30:45 +00:00
//fId = MF_RegisterSPForwardByName(amx, funcname, FP_CELL, FP_STRING, FP_STRING, FP_STRING, FP_CELL, FP_DONE);
2006-03-20 18:08:51 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2005-03-25 09:30:45 +00:00
DLLHOOK ( KeyValue ) ;
2004-08-03 19:45:48 +00:00
break ;
//DLLFunc_SetAbsBox, // void ) ( edict_t *pent );
case FM_SetAbsBox :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( SetAbsBox ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_ClientConnect :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_STRING , FP_STRING , FP_STRING , FP_DONE ) ; // TODO: 4th arg must be of set size 128?
2004-08-11 05:06:27 +00:00
DLLHOOK ( ClientConnect ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ClientDisconnect :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ClientDisconnect ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ClientKill :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ClientKill ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ClientPutInServer :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ClientPutInServer ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ClientCommand :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ClientCommand ) ;
2004-08-03 19:45:48 +00:00
break ;
case FM_ServerDeactivate :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ServerDeactivate ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_PlayerPreThink :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( PlayerPreThink ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_PlayerPostThink :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( PlayerPostThink ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_StartFrame :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( StartFrame ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ParmsNewLevel :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ParmsNewLevel ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_ParmsChangeLevel :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( ParmsChangeLevel ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_GetGameDescription :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
DLLHOOK ( GetGameDescription ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_SpectatorConnect :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( SpectatorConnect ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_SpectatorDisconnect :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( SpectatorDisconnect ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_SpectatorThink :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
2004-08-06 00:56:48 +00:00
DLLHOOK ( SpectatorThink ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_Sys_Error :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
DLLHOOK ( Sys_Error ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_PM_FindTextureType :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
DLLHOOK ( PM_FindTextureType ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-03 19:45:48 +00:00
case FM_RegisterEncoders :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 04:30:10 +00:00
DLLHOOK ( RegisterEncoders ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-07-28 03:14:07 +00:00
2004-08-03 19:45:48 +00:00
case FM_CreateInstancedBaselines :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 03:01:45 +00:00
DLLHOOK ( CreateInstancedBaselines ) ;
2004-08-03 19:45:48 +00:00
break ;
2004-08-11 05:06:27 +00:00
2004-08-06 03:01:45 +00:00
case FM_AllowLagCompensation :
2004-08-03 19:45:48 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
2004-08-06 03:01:45 +00:00
DLLHOOK ( AllowLagCompensation ) ;
2004-08-03 19:45:48 +00:00
break ;
2005-08-18 09:33:51 +00:00
// NEW_DLL_FUNCTIONS:
case FM_OnFreeEntPrivateData :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
NEWDLLHOOK ( OnFreeEntPrivateData ) ;
break ;
// Maybe it's not possible to hook this forward? O_o
case FM_GameShutdown :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_DONE ) ;
NEWDLLHOOK ( GameShutdown ) ;
break ;
case FM_ShouldCollide :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
NEWDLLHOOK ( ShouldCollide ) ;
break ;
2006-04-28 20:07:53 +00:00
case FM_ClientUserInfoChanged :
2006-05-10 11:19:24 +00:00
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
2006-03-30 00:31:33 +00:00
DLLHOOK ( ClientUserInfoChanged ) ;
break ;
2006-04-30 07:27:14 +00:00
case FM_UpdateClientData :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
DLLHOOK ( UpdateClientData ) ;
break ;
case FM_AddToFullPack :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
DLLHOOK ( AddToFullPack ) ;
break ;
case FM_CmdStart :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_DONE ) ;
DLLHOOK ( CmdStart ) ;
break ;
case FM_CmdEnd :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
DLLHOOK ( CmdEnd ) ;
break ;
2006-05-05 08:04:19 +00:00
case FM_CreateInstancedBaseline :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_DONE ) ;
ENGHOOK ( CreateInstancedBaseline ) ;
break ;
case FM_CreateBaseline :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_CELL , FP_ARRAY , FP_ARRAY , FP_DONE ) ;
DLLHOOK ( CreateBaseline ) ;
break ;
2006-05-10 11:19:24 +00:00
case FM_GetInfoKeyBuffer :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_DONE ) ;
ENGHOOK ( GetInfoKeyBuffer ) ;
break ;
2006-05-23 03:26:26 +00:00
case FM_ClientPrintf :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_CELL , FP_CELL , FP_STRING , FP_DONE ) ;
ENGHOOK ( ClientPrintf ) ;
break ;
2007-04-30 18:29:33 +00:00
case FM_ServerPrint :
fId = MF_RegisterSPForwardByName ( amx , funcname , FP_STRING , FP_DONE ) ;
ENGHOOK ( ServerPrint ) ;
break ;
2004-08-03 19:45:48 +00:00
#if 0
2004-07-28 03:14:07 +00:00
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.
MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev);
# endif
default :
fId = 0 ;
break ;
}
if ( ! fId )
2006-02-03 03:27:03 +00:00
{
MF_LogError ( amx , AMX_ERR_NATIVE , " Function not found (%d, %s) " , func , funcname ) ;
2004-07-28 03:14:07 +00:00
return 0 ;
2006-02-03 03:27:03 +00:00
}
2004-07-28 03:14:07 +00:00
if ( post )
{
2014-08-09 18:50:45 +00:00
EnginePost [ func ] . append ( fId ) ;
2004-07-28 03:14:07 +00:00
} else {
2014-08-09 18:50:45 +00:00
Engine [ func ] . append ( fId ) ;
2004-07-28 03:14:07 +00:00
}
2006-02-03 03:27:03 +00:00
return fId ;
2004-07-28 03:14:07 +00:00
}
2004-08-06 00:56:48 +00:00
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
static cell AMX_NATIVE_CALL get_orig_retval ( AMX * amx , cell * params )
{
int paramCount = params [ 0 ] / sizeof ( cell ) ;
cell * refFloatRet = 0 ;
switch ( paramCount )
{
case 0 :
return origCellRet ;
case 1 :
refFloatRet = MF_GetAmxAddr ( amx , params [ 1 ] ) ;
* refFloatRet = amx_ftoc ( origFloatRet ) ;
return 1 ;
case 2 :
MF_SetAmxString ( amx , params [ 1 ] , origStringRet , params [ 2 ] ) ;
return 1 ;
default :
MF_LogError ( amx , AMX_ERR_NATIVE , " Too many parameters passed " ) ;
return 0 ;
}
}
2004-08-06 00:56:48 +00:00
AMX_NATIVE_INFO forward_natives [ ] = {
{ " register_forward " , register_forward } ,
2006-02-03 03:27:03 +00:00
{ " unregister_forward " , unregister_forward } ,
2004-08-11 05:06:27 +00:00
{ " forward_return " , fm_return } ,
Oh dear, lots of changes:
1) Added get_orig_retval for retrieving the original return value of an engine function
2) Fixed engfunc being called with EngFunc_CheckVisibility so that it now works as intended
3) Hooks should now also work with FM_WalkMove, FM_TraceToss, FM_TraceMonsterHull, FM_TraceHull,
FM_TraceModel, FM_TraceTexture, FM_TraceSphere, FM_GetBonePosition, FM_GetAttachment, FM_RunPlayerMove,
FM_StaticDecal, FM_BuildSoundMsg and FM_CheckVisibility
4) Reformatted comments in some header files so they look a bit neater
2006-04-17 17:02:57 +00:00
{ " get_orig_retval " , get_orig_retval } ,
2004-08-06 00:56:48 +00:00
{ NULL , NULL }
2004-09-14 18:02:32 +00:00
} ;