浏览代码

Fix lighting_dirty flag bug

In rare circumstances, changing the geometry data attached to an instance, there was the opporunity for the lighting_dirty flag to get out of sync, which could lead to access to a stale light RID, and warnings or worse.

This PR fixes the problem by ensuring the lighting is always updated on the instance when first adding GeometryData.

(cherry picked from commit 26e93dc5c62edda9732bf3ad166296fcb439186a)
lawnjelly 3 年之前
父节点
当前提交
c4d44e3826
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      servers/visual/visual_server_scene.h

+ 1 - 1
servers/visual/visual_server_scene.h

@@ -324,7 +324,7 @@ public:
 		List<Instance *> lightmap_captures;
 
 		InstanceGeometryData() {
-			lighting_dirty = false;
+			lighting_dirty = true;
 			reflection_dirty = true;
 			can_cast_shadows = true;
 			material_is_animated = true;