diff --git a/src/client/refresh/gl1/gl1_light.c b/src/client/refresh/gl1/gl1_light.c index 333359c4..ad8c9a9d 100644 --- a/src/client/refresh/gl1/gl1_light.c +++ b/src/client/refresh/gl1/gl1_light.c @@ -118,7 +118,7 @@ R_RenderDlights(void) void RI_PushDlights(void) { - if (r_flashblend->value) + if (r_flashblend->value || !r_worldmodel) { return; } @@ -126,6 +126,6 @@ RI_PushDlights(void) /* because the count hasn't advanced yet for this frame */ r_dlightframecount = r_framecount + 1; - R_PushDlights(&r_newrefdef, r_worldmodel->nodes, r_dlightframecount, - r_worldmodel->surfaces); + R_PushDlights(&r_newrefdef, r_worldmodel->nodes, + r_dlightframecount, r_worldmodel->surfaces); } diff --git a/src/client/refresh/soft/sw_light.c b/src/client/refresh/soft/sw_light.c index 43efb655..e7f9f627 100644 --- a/src/client/refresh/soft/sw_light.c +++ b/src/client/refresh/soft/sw_light.c @@ -40,6 +40,11 @@ RI_PushDlights void RI_PushDlights(const model_t *model) { + if (!model) + { + return; + } + R_PushDlights(&r_newrefdef, model->nodes + model->firstnode, r_framecount, model->surfaces); } diff --git a/src/client/refresh/vk/vk_light.c b/src/client/refresh/vk/vk_light.c index a0bbafb8..127e402f 100644 --- a/src/client/refresh/vk/vk_light.c +++ b/src/client/refresh/vk/vk_light.c @@ -108,7 +108,7 @@ R_RenderDlights(void) void RI_PushDlights(void) { - if (r_flashblend->value) + if (r_flashblend->value || !r_worldmodel) { return; }