mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-12 16:18:01 +00:00
ref: gl: return NULL in GetEntityByIndex and ModelHandle just in case
This commit is contained in:
parent
c56e876043
commit
b946c8455d
@ -734,11 +734,17 @@ extern ref_host_t *gp_host;
|
|||||||
//
|
//
|
||||||
static inline cl_entity_t *CL_GetEntityByIndex( int index )
|
static inline cl_entity_t *CL_GetEntityByIndex( int index )
|
||||||
{
|
{
|
||||||
|
if( unlikely( index < 0 || index >= tr.max_entities || !tr.entities ))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return &tr.entities[index];
|
return &tr.entities[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline model_t *CL_ModelHandle( int index )
|
static inline model_t *CL_ModelHandle( int index )
|
||||||
{
|
{
|
||||||
|
if( unlikely( index < 0 || index >= gp_cl->nummodels ))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
return gp_cl->models[index];
|
return gp_cl->models[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user