From f7f069a38b757783be2318a4c48c396b8c29446e Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Sat, 5 Jun 2021 15:36:44 +0400 Subject: [PATCH] engine: client: added Host_Error for CL_EDICT_NUM (hotfix for issue #434) --- engine/client/client.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/client/client.h b/engine/client/client.h index 8e4dafaa..1d104459 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -844,6 +844,12 @@ movevars_t *pfnGetMoveVars( void ); _inline cl_entity_t *CL_EDICT_NUM( int n ) { + if( !clgame.entities ) + { + Host_Error( "CL_EDICT_NUM: clgame.entities is NULL\n"); + return NULL; + } + if(( n >= 0 ) && ( n < clgame.maxEntities )) return clgame.entities + n;