|
|
|
@ -62,16 +62,23 @@ qboolean SV_CheckEdict( const edict_t *e, const char *file, const int line )
@@ -62,16 +62,23 @@ qboolean SV_CheckEdict( const edict_t *e, const char *file, const int line )
|
|
|
|
|
|
|
|
|
|
static edict_t *SV_PEntityOfEntIndex( const int iEntIndex, const qboolean allentities ) |
|
|
|
|
{ |
|
|
|
|
edict_t *pEdict = EDICT_NUM( iEntIndex ); |
|
|
|
|
qboolean player = allentities ? iEntIndex <= svs.maxclients : iEntIndex < svs.maxclients; |
|
|
|
|
if( iEntIndex >= 0 && iEntIndex < GI->max_edicts ) |
|
|
|
|
{ |
|
|
|
|
edict_t *pEdict = EDICT_NUM( iEntIndex ); |
|
|
|
|
qboolean player = allentities ? iEntIndex <= svs.maxclients : iEntIndex < svs.maxclients; |
|
|
|
|
|
|
|
|
|
if( !SV_IsValidEdict( pEdict )) |
|
|
|
|
return NULL; |
|
|
|
|
if( !iEntIndex || FBitSet( host.features, ENGINE_QUAKE_COMPATIBLE )) |
|
|
|
|
return pEdict; // just get access to array
|
|
|
|
|
|
|
|
|
|
if( !player && !pEdict->pvPrivateData ) |
|
|
|
|
return NULL; |
|
|
|
|
if( SV_IsValidEdict( pEdict ) && pEdict->pvPrivateData ) |
|
|
|
|
return pEdict; |
|
|
|
|
|
|
|
|
|
return pEdict; |
|
|
|
|
// g-cont: world and clients can be accessed even without private data
|
|
|
|
|
if( SV_IsValidEdict( pEdict ) && player ) |
|
|
|
|
return pEdict; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|