2004-07-28 07:14:07 +04:00
# include "fakemeta_amxx.h"
2004-08-06 00:57:03 +04:00
edict_t * g_player_edicts [ 33 ] ; // Used for INDEXENT() forward.
2004-07-28 07:14:07 +04:00
void OnAmxxAttach ( )
{
2006-03-04 09:34:28 +03:00
initialze_offsets ( ) ;
2006-03-14 19:55:06 +03:00
initialize_glb_offsets ( ) ;
2004-07-28 07:14:07 +04:00
MF_AddNatives ( engfunc_natives ) ;
MF_AddNatives ( dllfunc_natives ) ;
2005-07-19 20:08:00 +04:00
MF_AddNatives ( pev_natives ) ;
2004-08-06 04:56:48 +04:00
MF_AddNatives ( forward_natives ) ;
2004-08-11 09:06:27 +04:00
MF_AddNatives ( pdata_natives ) ;
2004-09-15 03:39:22 +04:00
MF_AddNatives ( tr_Natives ) ;
2006-03-14 19:55:06 +03:00
MF_AddNatives ( glb_natives ) ;
2006-03-20 21:08:51 +03:00
MF_AddNatives ( ext2_natives ) ;
g_kvd_2 . szClassName = " " ;
g_kvd_2 . szKeyName = " " ;
g_kvd_2 . szValue = " " ;
g_kvd_glb . kvd = & g_kvd_2 ;
2004-08-06 00:57:03 +04:00
}
2006-03-20 21:08:51 +03:00
2004-08-11 09:06:27 +04:00
int GetHullBounds ( int hullnumber , float * mins , float * maxs ) ;
2004-08-06 00:57:03 +04:00
// sawce: Do not null out the forward for ServerActivate. It's required for the INDEXENT() fix. (I don't think ServerActivate is planned on being forwarded anyway)
void ServerActivate ( edict_t * pEdictList , int edictCount , int clientMax )
{
for ( int i = 1 ; i < = gpGlobals - > maxClients ; i + + )
g_player_edicts [ i ] = pEdictList + i ;
2006-04-29 11:23:23 +04:00
g_pFunctionTable - > pfnServerDeactivate = FMH_ServerDeactivate ;
2004-08-06 00:57:03 +04:00
RETURN_META ( MRES_IGNORED ) ;
}
2004-08-22 07:58:31 +04:00
# define RESETD(tcall) \
g_pFunctionTable - > pfn # # tcall = 0 ; \
g_pFunctionTable_Post - > pfn # # tcall = NULL ; \
2004-08-22 21:56:58 +04:00
Engine [ FM_ # # tcall ] . clear ( ) ; \
EnginePost [ FM_ # # tcall ] . clear ( )
2004-08-06 07:01:45 +04:00
# define RESETE(call) \
g_pengfuncsTable - > pfn # # call = NULL ; \
g_pengfuncsTable_Post - > pfn # # call = NULL ; \
Engine [ FM_ # # call ] . clear ( ) ; \
2004-08-22 07:58:31 +04:00
EnginePost [ FM_ # # call ] . clear ( )
2004-08-06 07:01:45 +04:00
2006-02-05 11:06:50 +03:00
# define RESETN(call) \
g_pNewFunctionsTable - > pfn # # call = NULL ; \
g_pNewFunctionsTable_Post - > pfn # # call = NULL ; \
Engine [ FM_ # # call ] . clear ( ) ; \
EnginePost [ FM_ # # call ] . clear ( ) ;
2006-04-29 11:23:23 +04:00
void FMH_ServerDeactivate ( )
2004-08-06 07:01:45 +04:00
{
// Reset all call lists here.
// NULL all function tables
RESETE ( PrecacheModel ) ;
RESETE ( PrecacheSound ) ;
RESETE ( SetModel ) ;
RESETE ( ModelIndex ) ;
RESETE ( ModelFrames ) ;
RESETE ( SetSize ) ;
RESETE ( ChangeLevel ) ;
RESETE ( VecToYaw ) ;
RESETE ( VecToAngles ) ;
RESETE ( MoveToOrigin ) ;
RESETE ( ChangeYaw ) ;
RESETE ( ChangePitch ) ;
RESETE ( FindEntityByString ) ;
RESETE ( GetEntityIllum ) ;
RESETE ( FindEntityInSphere ) ;
RESETE ( FindClientInPVS ) ;
RESETE ( EntitiesInPVS ) ;
RESETE ( MakeVectors ) ;
RESETE ( AngleVectors ) ;
RESETE ( CreateEntity ) ;
RESETE ( RemoveEntity ) ;
RESETE ( CreateNamedEntity ) ;
RESETE ( MakeStatic ) ;
RESETE ( EntIsOnFloor ) ;
RESETE ( DropToFloor ) ;
RESETE ( WalkMove ) ;
RESETE ( SetOrigin ) ;
RESETE ( EmitSound ) ;
RESETE ( EmitAmbientSound ) ;
RESETE ( TraceLine ) ;
RESETE ( TraceToss ) ;
RESETE ( TraceMonsterHull ) ;
RESETE ( TraceHull ) ;
RESETE ( TraceModel ) ;
RESETE ( TraceTexture ) ;
RESETE ( TraceSphere ) ;
RESETE ( GetAimVector ) ;
RESETE ( ParticleEffect ) ;
RESETE ( LightStyle ) ;
RESETE ( DecalIndex ) ;
RESETE ( PointContents ) ;
RESETE ( FreeEntPrivateData ) ;
RESETE ( SzFromIndex ) ;
RESETE ( AllocString ) ;
RESETE ( RegUserMsg ) ;
RESETE ( AnimationAutomove ) ;
RESETE ( GetBonePosition ) ;
RESETE ( GetAttachment ) ;
RESETE ( SetView ) ;
RESETE ( Time ) ;
RESETE ( CrosshairAngle ) ;
RESETE ( FadeClientVolume ) ;
RESETE ( SetClientMaxspeed ) ;
RESETE ( CreateFakeClient ) ;
RESETE ( RunPlayerMove ) ;
RESETE ( NumberOfEntities ) ;
RESETE ( StaticDecal ) ;
RESETE ( PrecacheGeneric ) ;
RESETE ( BuildSoundMsg ) ;
RESETE ( GetPhysicsKeyValue ) ;
RESETE ( SetPhysicsKeyValue ) ;
RESETE ( GetPhysicsInfoString ) ;
RESETE ( PrecacheEvent ) ;
RESETE ( PlaybackEvent ) ;
RESETE ( CheckVisibility ) ;
RESETE ( GetCurrentPlayer ) ;
RESETE ( CanSkipPlayer ) ;
RESETE ( SetGroupMask ) ;
RESETE ( Voice_GetClientListening ) ;
RESETE ( Voice_SetClientListening ) ;
RESETE ( InfoKeyValue ) ;
RESETE ( SetKeyValue ) ;
RESETE ( SetClientKeyValue ) ;
2004-08-11 09:06:27 +04:00
RESETE ( MessageBegin ) ;
RESETE ( MessageEnd ) ;
RESETE ( WriteByte ) ;
RESETE ( WriteChar ) ;
RESETE ( WriteShort ) ;
RESETE ( WriteLong ) ;
RESETE ( WriteAngle ) ;
RESETE ( WriteCoord ) ;
RESETE ( WriteString ) ;
RESETE ( WriteEntity ) ;
RESETE ( CVarGetFloat ) ;
RESETE ( CVarGetString ) ;
RESETE ( CVarSetFloat ) ;
RESETE ( CVarSetString ) ;
2006-02-05 11:06:50 +03:00
RESETE ( AlertMessage ) ;
2006-05-05 12:04:19 +04:00
RESETE ( CreateInstancedBaseline ) ;
2004-08-06 07:01:45 +04:00
RESETD ( Spawn ) ;
RESETD ( Think ) ;
RESETD ( Use ) ;
RESETD ( Touch ) ;
RESETD ( Blocked ) ;
RESETD ( KeyValue ) ;
RESETD ( SetAbsBox ) ;
RESETD ( ClientConnect ) ;
RESETD ( ClientDisconnect ) ;
RESETD ( ClientKill ) ;
RESETD ( ClientPutInServer ) ;
RESETD ( ClientCommand ) ;
RESETD ( ServerDeactivate ) ;
RESETD ( PlayerPreThink ) ;
RESETD ( PlayerPostThink ) ;
RESETD ( StartFrame ) ;
RESETD ( ParmsNewLevel ) ;
RESETD ( ParmsChangeLevel ) ;
RESETD ( GetGameDescription ) ;
RESETD ( SpectatorConnect ) ;
RESETD ( SpectatorDisconnect ) ;
RESETD ( SpectatorThink ) ;
RESETD ( Sys_Error ) ;
RESETD ( PM_FindTextureType ) ;
RESETD ( RegisterEncoders ) ;
RESETD ( CreateInstancedBaselines ) ;
RESETD ( AllowLagCompensation ) ;
2006-04-29 00:07:53 +04:00
RESETD ( ClientUserInfoChanged ) ;
2006-04-30 11:27:14 +04:00
RESETD ( UpdateClientData ) ;
RESETD ( AddToFullPack ) ;
RESETD ( CmdStart ) ;
RESETD ( CmdEnd ) ;
2006-05-05 12:04:19 +04:00
RESETD ( CreateBaseline ) ;
2004-08-06 07:01:45 +04:00
2006-02-05 11:06:50 +03:00
RESETN ( OnFreeEntPrivateData ) ;
RESETN ( GameShutdown ) ;
RESETN ( ShouldCollide ) ;
2004-08-06 07:01:45 +04:00
g_pFunctionTable - > pfnServerActivate = ServerActivate ;
2006-04-29 17:51:52 +04:00
RETURN_META ( MRES_IGNORED ) ;
2004-08-22 07:58:31 +04:00
}