From a7d02b8268b47e6d046d631441b6018e890cb86a Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Wed, 6 Apr 2022 20:38:04 +0400 Subject: [PATCH] ref_gl: gl_rlight: fixed game crash in Customize multiplayer menu --- ref_gl/gl_rlight.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ref_gl/gl_rlight.c b/ref_gl/gl_rlight.c index c0c0c5fc..89679989 100644 --- a/ref_gl/gl_rlight.c +++ b/ref_gl/gl_rlight.c @@ -153,7 +153,8 @@ void R_PushDlights( void ) tr.dlightframecount = tr.framecount; RI.currententity = gEngfuncs.GetEntityByIndex( 0 ); - RI.currentmodel = RI.currententity->model; + if( RI.currententity ) + RI.currentmodel = RI.currententity->model; for( i = 0; i < MAX_DLIGHTS; i++, l++ ) { @@ -165,7 +166,8 @@ void R_PushDlights( void ) if( GL_FrustumCullSphere( &RI.frustum, l->origin, l->radius, 15 )) continue; - R_MarkLights( l, 1<nodes ); + if( RI.currententity ) + R_MarkLights( l, 1<nodes ); } }