@colyseus/schema 3.0.45 → 3.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +3 -2
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +3 -2
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +3 -2
- package/lib/encoder/ChangeTree.js +3 -1
- package/lib/encoder/ChangeTree.js.map +1 -1
- package/lib/encoder/Root.js +0 -1
- package/lib/encoder/Root.js.map +1 -1
- package/package.json +1 -1
- package/src/encoder/ChangeTree.ts +3 -1
- package/src/encoder/Root.ts +0 -1
package/build/esm/index.mjs
CHANGED
|
@@ -1424,7 +1424,9 @@ class ChangeTree {
|
|
|
1424
1424
|
*/
|
|
1425
1425
|
addParent(parent, index) {
|
|
1426
1426
|
// Check if this parent already exists in the chain
|
|
1427
|
-
if (this.hasParent((p,
|
|
1427
|
+
if (this.hasParent((p, _) => p[$changes] === parent[$changes])) {
|
|
1428
|
+
// if (this.hasParent((p, i) => p[$changes] === parent[$changes] && i === index)) {
|
|
1429
|
+
this.parentChain.index = index;
|
|
1428
1430
|
return;
|
|
1429
1431
|
}
|
|
1430
1432
|
this.parentChain = {
|
|
@@ -3922,7 +3924,6 @@ class Root {
|
|
|
3922
3924
|
}
|
|
3923
3925
|
remove(changeTree) {
|
|
3924
3926
|
const refCount = (this.refCount[changeTree.refId]) - 1;
|
|
3925
|
-
// console.log("REMOVE", { refId: changeTree.refId, refCount });
|
|
3926
3927
|
if (refCount <= 0) {
|
|
3927
3928
|
//
|
|
3928
3929
|
// Only remove "root" reference if it's the last reference
|