diff --git a/engine/server/server.h b/engine/server/server.h index 674cffd9..476f42ca 100644 --- a/engine/server/server.h +++ b/engine/server/server.h @@ -625,12 +625,18 @@ void SV_RestartAmbientSounds( void ); void SV_RestartDecals( void ); void SV_RestartStaticEnts( void ); int pfnDropToFloor( edict_t* e ); -edict_t *SV_EdictNum( int n ); void SV_SetModel( edict_t *ent, const char *name ); int pfnDecalIndex( const char *m ); void SV_CreateDecal( sizebuf_t *msg, const float *origin, int decalIndex, int entityIndex, int modelIndex, int flags, float scale ); qboolean SV_RestoreCustomDecal( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent ); +static inline edict_t *SV_EdictNum( int n ) +{ + if( likely( n >= 0 && n < GI->max_edicts )) + return &svgame.edicts[n]; + return NULL; +} + // // sv_log.c // diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 4187ad01..b479ef7a 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -39,13 +39,6 @@ static vec3_t viewPoint[MAX_CLIENTS]; typedef void (__cdecl *LINK_ENTITY_FUNC)( entvars_t *pev ); typedef void (__stdcall *GIVEFNPTRSTODLL)( enginefuncs_t* engfuncs, globalvars_t *pGlobals ); -edict_t *SV_EdictNum( int n ) -{ - if(( n >= 0 ) && ( n < GI->max_edicts )) - return svgame.edicts + n; - return NULL; -} - #ifndef NDEBUG qboolean SV_CheckEdict( const edict_t *e, const char *file, const int line ) {