浏览代码

Fix #10723, a regression from 7a07895

Using @akien-mga's patch
Bojidar Marinov 8 年之前
父节点
当前提交
839083789a
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      servers/visual/visual_server_scene.cpp

+ 4 - 3
servers/visual/visual_server_scene.cpp

@@ -1473,9 +1473,10 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam
 
 			//check shadow..
 
-			if (light && p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(E->get()->base)) {
-				lights_with_shadow[directional_shadow_count++] = E->get();
-
+			if (light) {
+				if (p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(E->get()->base)) {
+					lights_with_shadow[directional_shadow_count++] = E->get();
+				}
 				//add to list
 				directional_light_ptr[directional_light_count++] = light->instance;
 			}