2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-22 17:01:14 +01:00

ref: soft: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view)

This commit is contained in:
Alibek Omarov 2024-01-27 17:31:34 +03:00
parent eaafd0ff13
commit 901b35d4b1

View File

@ -156,8 +156,12 @@ void R_PushDlights( void )
tr.dlightframecount = tr.framecount;
RI.currententity = CL_GetEntityByIndex( 0 );
if( RI.currententity )
RI.currentmodel = RI.currententity->model;
// no world -- no dlights
if( !RI.currententity )
return;
RI.currentmodel = RI.currententity->model;
for( i = 0; i < MAX_DLIGHTS; i++, l++ )
{
@ -169,8 +173,7 @@ void R_PushDlights( void )
//if( GL_FrustumCullSphere( &RI.frustum, l->origin, l->radius, 15 ))
//continue;
if( RI.currententity )
R_MarkLights( l, 1<<i, RI.currentmodel->nodes );
R_MarkLights( l, 1<<i, RI.currentmodel->nodes );
}
}