Explorar o código

Fix bug in DynamicFloatArray.sort()

nockawa %!s(int64=9) %!d(string=hai) anos
pai
achega
8aa34ac2c6
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/Tools/babylon.dynamicFloatArray.ts

+ 4 - 1
src/Tools/babylon.dynamicFloatArray.ts

@@ -259,7 +259,10 @@
                 let newCount = Math.min(this.totalElementCount, count * 2);
 
                 this._sortTable = new Array<SortInfo>(newCount);
-                this._sortedTable = new Array<SortInfo>(newCount);
+            }
+
+            if (!this._sortTable || this._sortTable.length !== count) {
+                this._sortedTable = new Array<SortInfo>(count);
             }
 
             // Because, you know...