From c6e1edf17fe05aa9cb2dd024e60f689f5d3c9ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Wed, 7 Oct 2026 16:41:56 +0200 Subject: [PATCH] Add fix temporarily --- examples/3d-light-playground/3d-light-playground.json | 11 +++++++++++ .../starting-first-person-horror.json | 11 +++++++++++ .../starting-first-person-shooter-horror.json | 11 +++++++++++ .../starting-fnaf-five-nights-at-freddys.json | 11 +++++++++++ 4 files changed, 44 insertions(+) diff --git a/examples/3d-light-playground/3d-light-playground.json b/examples/3d-light-playground/3d-light-playground.json index 4db9148f4..492e88cbd 100644 --- a/examples/3d-light-playground/3d-light-playground.json +++ b/examples/3d-light-playground/3d-light-playground.json @@ -4317,6 +4317,17 @@ " * @param sortDistance {number} The squared distance to the camera.", " */", " insertByDistance(object, sortDistance) {", + " // A render can happen without a game step in between (the editor", + " // and the gameplay test harness render a paused game), so a light", + " // can be offered again before the lists were cleared. Keep it once,", + " // or the duplicates would evict the other lights - but apply its", + " // state again, as the renderer reset it before offering the light.", + " for (const pair of this.objects) {", + " if (pair.object === object) {", + " this.onInsertion(object);", + " return;", + " }", + " }", " let insertionIndex = 0;", " for (let index = this.objects.length - 1; index >= 0; index--) {", " if (sortDistance >= this.objects[index].sortDistance) {", diff --git a/examples/starting-first-person-horror/starting-first-person-horror.json b/examples/starting-first-person-horror/starting-first-person-horror.json index 77fbe298b..b2e48dbf1 100644 --- a/examples/starting-first-person-horror/starting-first-person-horror.json +++ b/examples/starting-first-person-horror/starting-first-person-horror.json @@ -18532,6 +18532,17 @@ " * @param sortDistance {number} The squared distance to the camera.", " */", " insertByDistance(object, sortDistance) {", + " // A render can happen without a game step in between (the editor", + " // and the gameplay test harness render a paused game), so a light", + " // can be offered again before the lists were cleared. Keep it once,", + " // or the duplicates would evict the other lights - but apply its", + " // state again, as the renderer reset it before offering the light.", + " for (const pair of this.objects) {", + " if (pair.object === object) {", + " this.onInsertion(object);", + " return;", + " }", + " }", " let insertionIndex = 0;", " for (let index = this.objects.length - 1; index >= 0; index--) {", " if (sortDistance >= this.objects[index].sortDistance) {", diff --git a/examples/starting-first-person-shooter-horror/starting-first-person-shooter-horror.json b/examples/starting-first-person-shooter-horror/starting-first-person-shooter-horror.json index 545b5e236..840c64b55 100644 --- a/examples/starting-first-person-shooter-horror/starting-first-person-shooter-horror.json +++ b/examples/starting-first-person-shooter-horror/starting-first-person-shooter-horror.json @@ -41557,6 +41557,17 @@ " * @param sortDistance {number} The squared distance to the camera.", " */", " insertByDistance(object, sortDistance) {", + " // A render can happen without a game step in between (the editor", + " // and the gameplay test harness render a paused game), so a light", + " // can be offered again before the lists were cleared. Keep it once,", + " // or the duplicates would evict the other lights - but apply its", + " // state again, as the renderer reset it before offering the light.", + " for (const pair of this.objects) {", + " if (pair.object === object) {", + " this.onInsertion(object);", + " return;", + " }", + " }", " let insertionIndex = 0;", " for (let index = this.objects.length - 1; index >= 0; index--) {", " if (sortDistance >= this.objects[index].sortDistance) {", diff --git a/examples/starting-fnaf-five-nights-at-freddys/starting-fnaf-five-nights-at-freddys.json b/examples/starting-fnaf-five-nights-at-freddys/starting-fnaf-five-nights-at-freddys.json index 6db40d4b6..815b718b9 100644 --- a/examples/starting-fnaf-five-nights-at-freddys/starting-fnaf-five-nights-at-freddys.json +++ b/examples/starting-fnaf-five-nights-at-freddys/starting-fnaf-five-nights-at-freddys.json @@ -10853,6 +10853,17 @@ " * @param sortDistance {number} The squared distance to the camera.", " */", " insertByDistance(object, sortDistance) {", + " // A render can happen without a game step in between (the editor", + " // and the gameplay test harness render a paused game), so a light", + " // can be offered again before the lists were cleared. Keep it once,", + " // or the duplicates would evict the other lights - but apply its", + " // state again, as the renderer reset it before offering the light.", + " for (const pair of this.objects) {", + " if (pair.object === object) {", + " this.onInsertion(object);", + " return;", + " }", + " }", " let insertionIndex = 0;", " for (let index = this.objects.length - 1; index >= 0; index--) {", " if (sortDistance >= this.objects[index].sortDistance) {",