Pārlūkot izejas kodu

Merge pull request #5241 from sebavan/master

My Bad 2 ...
David Catuhe 7 gadi atpakaļ
vecāks
revīzija
f1a423d7f9
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      src/babylon.sceneComponent.ts

+ 4 - 1
src/babylon.sceneComponent.ts

@@ -205,9 +205,12 @@
         public registerStep(index: number, component: ISceneComponent, action: T): void {
             let i = 0;
             let maxIndex = Number.MAX_VALUE;
-            for (; i < this.length && i < maxIndex; i++) {
+            for (; i < this.length; i++) {
                 let step = this[i];
                 maxIndex = step.index;
+                if (index < maxIndex) {
+                    break;
+                }
             }
             this.splice(i, 0, { index, component, action: action.bind(component) });
         }