engine: client: allocate static entities only when server sends static entity packet

This commit is contained in:
Alibek Omarov
2024-12-18 06:57:43 +03:00
parent 2aa13c8347
commit 98e587285b
4 changed files with 13 additions and 7 deletions
+5 -2
View File
@@ -311,10 +311,13 @@ static client entity
static void CL_ParseStaticEntity( sizebuf_t *msg )
{
int i, newnum;
entity_state_t from, to;
const entity_state_t from = { 0 };
entity_state_t to;
cl_entity_t *ent;
memset( &from, 0, sizeof( from ));
if( !clgame.static_entities )
clgame.static_entities = Mem_Calloc( clgame.mempool, sizeof( cl_entity_t ) * MAX_STATIC_ENTITIES );
newnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
MSG_ReadDeltaEntity( msg, &from, &to, 0, DELTA_STATIC, cl.mtime[0] );