From c4d44e38264351df69f93b4cc2ad9f68d6fe5bf7 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 11 Dec 2021 11:27:21 +0000 Subject: [PATCH] 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) --- servers/visual/visual_server_scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index f1fcc7d6d8c..62f5f0c78b1 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -324,7 +324,7 @@ public: List lightmap_captures; InstanceGeometryData() { - lighting_dirty = false; + lighting_dirty = true; reflection_dirty = true; can_cast_shadows = true; material_is_animated = true;