Skip to content

Commit

Permalink
ref: soft: rework @SNMetamorph's fix for avoiding crash when no world…
Browse files Browse the repository at this point in the history
… is set (like Customize menu with enabled 3D view)
  • Loading branch information
a1batross committed Jan 27, 2024
1 parent eaafd0f commit 901b35d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ref/soft/r_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++ )
{
Expand All @@ -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 );
}
}

Expand Down

0 comments on commit 901b35d

Please sign in to comment.