diff --git a/src/engine/renderer/tr_scene.cpp b/src/engine/renderer/tr_scene.cpp index ba568cb82c..5cdaa548a2 100644 --- a/src/engine/renderer/tr_scene.cpp +++ b/src/engine/renderer/tr_scene.cpp @@ -299,14 +299,6 @@ void RE_AddDynamicLightToScene( const vec3_t org, float radius, float intensity, return; } - // set last lights restrictInteractionEnd if needed - if ( r_numLights > r_firstSceneLight ) { - light = &backEndData[ tr.smpFrame ]->lights[ r_numLights - 1 ]; - if( light->restrictInteractionFirst >= 0 ) { - light->restrictInteractionLast = r_numEntities - r_firstSceneEntity - 1; - } - } - if ( r_numLights >= MAX_REF_LIGHTS ) { return; @@ -317,6 +309,14 @@ void RE_AddDynamicLightToScene( const vec3_t org, float radius, float intensity, return; } + // set last lights restrictInteractionEnd if needed + if ( r_numLights > r_firstSceneLight ) { + light = &backEndData[ tr.smpFrame ]->lights[ r_numLights - 1 ]; + if( light->restrictInteractionFirst >= 0 ) { + light->restrictInteractionLast = r_numEntities - r_firstSceneEntity - 1; + } + } + light = &backEndData[ tr.smpFrame ]->lights[ r_numLights++ ]; light->l.rlType = refLightType_t::RL_OMNI;