2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-26 11:49:25 +01:00

engine: client: try to fix random crash in CL_ClearWorld when using legacy protocol

This commit is contained in:
Alibek Omarov 2023-04-15 03:36:33 +03:00
parent 25d6b2b069
commit 101a7a1240

View File

@ -1066,14 +1066,16 @@ void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize )
void CL_ClearWorld( void )
{
cl_entity_t *worldmodel;
if( clgame.entities ) // check if we have entities, legacy protocol support kinda breaks this logic
{
cl_entity_t *worldmodel = clgame.entities;
worldmodel = clgame.entities;
worldmodel->curstate.modelindex = 1; // world model
worldmodel->curstate.solid = SOLID_BSP;
worldmodel->curstate.movetype = MOVETYPE_PUSH;
worldmodel->model = cl.worldmodel;
worldmodel->index = 0;
worldmodel->curstate.modelindex = 1; // world model
worldmodel->curstate.solid = SOLID_BSP;
worldmodel->curstate.movetype = MOVETYPE_PUSH;
worldmodel->model = cl.worldmodel;
worldmodel->index = 0;
}
world.max_recursion = 0;