mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 15:47:55 +00:00
ref: gl: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view)
This commit is contained in:
parent
963d9b8f2a
commit
eaafd0ff13
@ -153,8 +153,12 @@ void R_PushDlights( void )
|
|||||||
tr.dlightframecount = tr.framecount;
|
tr.dlightframecount = tr.framecount;
|
||||||
|
|
||||||
RI.currententity = CL_GetEntityByIndex( 0 );
|
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++ )
|
for( i = 0; i < MAX_DLIGHTS; i++, l++ )
|
||||||
{
|
{
|
||||||
@ -166,8 +170,7 @@ void R_PushDlights( void )
|
|||||||
if( GL_FrustumCullSphere( &RI.frustum, l->origin, l->radius, 15 ))
|
if( GL_FrustumCullSphere( &RI.frustum, l->origin, l->radius, 15 ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( RI.currententity )
|
R_MarkLights( l, 1<<i, RI.currentmodel->nodes );
|
||||||
R_MarkLights( l, 1<<i, RI.currentmodel->nodes );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user